@backifydev/cli 0.4.12 → 0.4.13
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/index.js +210 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2116,7 +2116,7 @@ var require_postgres_date = __commonJS({
|
|
|
2116
2116
|
year = bcYearToNegativeYear(year);
|
|
2117
2117
|
}
|
|
2118
2118
|
var month = parseInt(matches[2], 10) - 1;
|
|
2119
|
-
var
|
|
2119
|
+
var day4 = matches[3];
|
|
2120
2120
|
var hour = parseInt(matches[4], 10);
|
|
2121
2121
|
var minute = parseInt(matches[5], 10);
|
|
2122
2122
|
var second = parseInt(matches[6], 10);
|
|
@@ -2125,7 +2125,7 @@ var require_postgres_date = __commonJS({
|
|
|
2125
2125
|
var date4;
|
|
2126
2126
|
var offset = timeZoneOffset(isoDate);
|
|
2127
2127
|
if (offset != null) {
|
|
2128
|
-
date4 = new Date(Date.UTC(year, month,
|
|
2128
|
+
date4 = new Date(Date.UTC(year, month, day4, hour, minute, second, ms));
|
|
2129
2129
|
if (is0To99(year)) {
|
|
2130
2130
|
date4.setUTCFullYear(year);
|
|
2131
2131
|
}
|
|
@@ -2133,7 +2133,7 @@ var require_postgres_date = __commonJS({
|
|
|
2133
2133
|
date4.setTime(date4.getTime() - offset);
|
|
2134
2134
|
}
|
|
2135
2135
|
} else {
|
|
2136
|
-
date4 = new Date(year, month,
|
|
2136
|
+
date4 = new Date(year, month, day4, hour, minute, second, ms);
|
|
2137
2137
|
if (is0To99(year)) {
|
|
2138
2138
|
date4.setFullYear(year);
|
|
2139
2139
|
}
|
|
@@ -2151,8 +2151,8 @@ var require_postgres_date = __commonJS({
|
|
|
2151
2151
|
year = bcYearToNegativeYear(year);
|
|
2152
2152
|
}
|
|
2153
2153
|
var month = parseInt(matches[2], 10) - 1;
|
|
2154
|
-
var
|
|
2155
|
-
var date4 = new Date(year, month,
|
|
2154
|
+
var day4 = matches[3];
|
|
2155
|
+
var date4 = new Date(year, month, day4);
|
|
2156
2156
|
if (is0To99(year)) {
|
|
2157
2157
|
date4.setFullYear(year);
|
|
2158
2158
|
}
|
|
@@ -8043,7 +8043,7 @@ var init_package = __esm({
|
|
|
8043
8043
|
"package.json"() {
|
|
8044
8044
|
package_default = {
|
|
8045
8045
|
name: "@backifydev/cli",
|
|
8046
|
-
version: "0.4.
|
|
8046
|
+
version: "0.4.13",
|
|
8047
8047
|
description: "Command-line setup and diagnostics for Backify applications",
|
|
8048
8048
|
type: "module",
|
|
8049
8049
|
bin: {
|
|
@@ -8142,17 +8142,17 @@ function showClientNotice(response, store = fileNoticeStore, write = (text2) =>
|
|
|
8142
8142
|
const notice = response.headers.get("backify-client-notice");
|
|
8143
8143
|
if (!notice) return false;
|
|
8144
8144
|
const shownAt = store.read();
|
|
8145
|
-
if (shownAt !== void 0 && now - shownAt <
|
|
8145
|
+
if (shownAt !== void 0 && now - shownAt < day3 && shownAt <= now) return false;
|
|
8146
8146
|
store.write(now);
|
|
8147
8147
|
write("Backify: " + notice.replace(/[\u0000-\u001f\u007f]/g, " ").slice(0, 300) + "\n");
|
|
8148
8148
|
return true;
|
|
8149
8149
|
}
|
|
8150
|
-
var
|
|
8150
|
+
var day3, noticeFile, fileNoticeStore;
|
|
8151
8151
|
var init_compatibility = __esm({
|
|
8152
8152
|
"src/compatibility.ts"() {
|
|
8153
8153
|
"use strict";
|
|
8154
8154
|
init_cli_session();
|
|
8155
|
-
|
|
8155
|
+
day3 = 24 * 60 * 60 * 1e3;
|
|
8156
8156
|
noticeFile = () => join6(homedir(), ".backify-client-notice.json");
|
|
8157
8157
|
fileNoticeStore = {
|
|
8158
8158
|
read: () => {
|
|
@@ -11099,7 +11099,7 @@ function datetime(args2) {
|
|
|
11099
11099
|
const timeRegex = args2.local ? `${qualified}|${timeSource({ precision: args2.precision })}` : qualified;
|
|
11100
11100
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
11101
11101
|
}
|
|
11102
|
-
var cuid, cuid2, ulid, xid, ksuid, nanoid, duration2,
|
|
11102
|
+
var cuid, cuid2, ulid, xid, ksuid, nanoid, duration2, guid7, uuid9, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base642, base64url, httpProtocol, e164, dateSource, date, anyString, bigint, integer2, number, boolean, _null, lowercase, uppercase;
|
|
11103
11103
|
var init_regexes = __esm({
|
|
11104
11104
|
"../../node_modules/zod/v4/core/regexes.js"() {
|
|
11105
11105
|
cuid = /^[cC][0-9a-z]{6,}$/;
|
|
@@ -11109,7 +11109,7 @@ var init_regexes = __esm({
|
|
|
11109
11109
|
ksuid = /^[A-Za-z0-9]{27}$/;
|
|
11110
11110
|
nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
11111
11111
|
duration2 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
11112
|
-
|
|
11112
|
+
guid7 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
11113
11113
|
uuid9 = (version2) => {
|
|
11114
11114
|
if (!version2)
|
|
11115
11115
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
@@ -12124,7 +12124,7 @@ var init_schemas = __esm({
|
|
|
12124
12124
|
$ZodString.init(inst, def);
|
|
12125
12125
|
});
|
|
12126
12126
|
$ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
|
|
12127
|
-
def.pattern ?? (def.pattern =
|
|
12127
|
+
def.pattern ?? (def.pattern = guid7);
|
|
12128
12128
|
$ZodStringFormat.init(inst, def);
|
|
12129
12129
|
});
|
|
12130
12130
|
$ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
@@ -26654,8 +26654,8 @@ var require_formats = __commonJS({
|
|
|
26654
26654
|
return false;
|
|
26655
26655
|
const year = +matches[1];
|
|
26656
26656
|
const month = +matches[2];
|
|
26657
|
-
const
|
|
26658
|
-
return month >= 1 && month <= 12 &&
|
|
26657
|
+
const day4 = +matches[3];
|
|
26658
|
+
return month >= 1 && month <= 12 && day4 >= 1 && day4 <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
|
|
26659
26659
|
}
|
|
26660
26660
|
function compareDate(d1, d2) {
|
|
26661
26661
|
if (!(d1 && d2))
|
|
@@ -34527,6 +34527,143 @@ function formatNotifications(page) {
|
|
|
34527
34527
|
return lines.join("\n");
|
|
34528
34528
|
}
|
|
34529
34529
|
|
|
34530
|
+
// src/legal.ts
|
|
34531
|
+
init_human_task();
|
|
34532
|
+
var legalUsage = [
|
|
34533
|
+
"Use backify legal [--organization <id>] [--json] [--open]:",
|
|
34534
|
+
" Shows which Terms of Service and Acceptable Use Policy version the organization accepted, whether an organization owner must accept",
|
|
34535
|
+
" a newer one and by when, and whether new deployments are paused until they do. --open opens the Portal page in the browser.",
|
|
34536
|
+
" Accepting the terms is a person's legal statement, so it cannot be done from the CLI or a coding agent: an organization owner",
|
|
34537
|
+
" accepts in the Backify Portal. --organization defaults to the signed-in organization."
|
|
34538
|
+
].join("\n");
|
|
34539
|
+
var guid3 = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
|
|
34540
|
+
function organizationTarget(args2, signedIn) {
|
|
34541
|
+
const index = args2.indexOf("--organization");
|
|
34542
|
+
const id = index >= 0 ? args2[index + 1] : signedIn();
|
|
34543
|
+
if (index >= 0 && (id === void 0 || id.startsWith("--"))) throw new Error("--organization needs an organization ID (UUID).");
|
|
34544
|
+
if (!id) throw new Error("Pass --organization <id>, or sign in first: backify login");
|
|
34545
|
+
if (!guid3.test(id)) throw new Error("--organization must be a UUID.");
|
|
34546
|
+
return id.toLowerCase();
|
|
34547
|
+
}
|
|
34548
|
+
var legalPath = (organizationId) => `/organizations/${organizationId}/legal`;
|
|
34549
|
+
function portalLink(portalUrl, path) {
|
|
34550
|
+
if (!portalUrl || !path || !path.startsWith("/") || path.startsWith("//") || path.includes("\\")) return void 0;
|
|
34551
|
+
let origin;
|
|
34552
|
+
try {
|
|
34553
|
+
origin = portalOrigin2(portalUrl);
|
|
34554
|
+
} catch {
|
|
34555
|
+
return void 0;
|
|
34556
|
+
}
|
|
34557
|
+
const url2 = new URL(origin);
|
|
34558
|
+
url2.pathname = path;
|
|
34559
|
+
return url2.origin === origin ? url2.toString() : void 0;
|
|
34560
|
+
}
|
|
34561
|
+
var day = (value) => value ? value.slice(0, 10) : void 0;
|
|
34562
|
+
function legalLines(status, portalUrl) {
|
|
34563
|
+
const link = portalLink(portalUrl, status.acceptPath) ?? status.acceptPath;
|
|
34564
|
+
const lines = [
|
|
34565
|
+
`Current version: ${status.currentVersion}.`,
|
|
34566
|
+
status.acceptedVersion ? `Accepted version: ${status.acceptedVersion}` + (status.acceptedAt ? ` (accepted ${day(status.acceptedAt)}).` : ".") : "Accepted version: none recorded."
|
|
34567
|
+
];
|
|
34568
|
+
if (status.acceptanceRequired) {
|
|
34569
|
+
lines.push(`Acceptance required: an organization owner must accept version ${status.currentVersion}` + (status.acceptBy ? ` by ${day(status.acceptBy)}.` : "."));
|
|
34570
|
+
lines.push(status.deploymentsPaused ? "Deployments: new deployments are paused until an owner accepts. Running applications are not affected." : status.acceptBy ? "Deployments: running; new deployments pause after the deadline until an owner accepts." : "Deployments: running.");
|
|
34571
|
+
} else lines.push("Acceptance required: no, the organization accepted the current version.", "Deployments: not paused by the terms.");
|
|
34572
|
+
lines.push(
|
|
34573
|
+
`Terms of Service: ${status.termsUrl}`,
|
|
34574
|
+
`Acceptable Use Policy: ${status.acceptableUseUrl}`,
|
|
34575
|
+
`Data Processing Agreement: ${status.dpaUrl}`,
|
|
34576
|
+
`Privacy Policy: ${status.privacyUrl}`
|
|
34577
|
+
);
|
|
34578
|
+
lines.push(status.acceptanceRequired ? `An organization owner accepts in the Backify Portal: ${link} (accepting cannot be done from the CLI).` : `Backify Portal: ${link}`);
|
|
34579
|
+
return lines;
|
|
34580
|
+
}
|
|
34581
|
+
function legalStatusSummary(status, portalUrl) {
|
|
34582
|
+
if (!status?.acceptanceRequired) return void 0;
|
|
34583
|
+
const acceptUrl = portalLink(portalUrl, status.acceptPath) ?? status.acceptPath;
|
|
34584
|
+
const message = (status.deploymentsPaused ? `New deployments are paused until an organization owner accepts the updated Terms of Service (version ${status.currentVersion}).` : `An organization owner must accept the updated Terms of Service (version ${status.currentVersion})` + (status.acceptBy ? ` by ${day(status.acceptBy)}; after that new deployments pause.` : ".")) + ` They accept in the Backify Portal: ${acceptUrl}`;
|
|
34585
|
+
return { ...status, acceptUrl, message };
|
|
34586
|
+
}
|
|
34587
|
+
function legalErrorHint(message) {
|
|
34588
|
+
return message.startsWith("legal_acceptance_required") ? "Run backify legal to see the deadline and the Backify Portal page where an organization owner accepts (backify legal --open opens it)." : void 0;
|
|
34589
|
+
}
|
|
34590
|
+
|
|
34591
|
+
// src/suspension.ts
|
|
34592
|
+
var suspensionUsage = [
|
|
34593
|
+
"Use backify suspension [--app <id> | --organization <id>] [--json]:",
|
|
34594
|
+
" Shows whether Backify suspended the application (or organization) under its Acceptable Use Policy, why, and where to appeal.",
|
|
34595
|
+
" A suspended application is not served, deployed or changed. Organization owners appeal in the Backify Portal page shown (or by",
|
|
34596
|
+
" email to the address shown); appeals cannot be made from the CLI. backify decisions lists every decision and its appeal status."
|
|
34597
|
+
].join("\n");
|
|
34598
|
+
var guid4 = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
|
|
34599
|
+
function suspensionPath(args2, projectApplication2) {
|
|
34600
|
+
const option2 = (name2) => {
|
|
34601
|
+
const index = args2.indexOf(name2);
|
|
34602
|
+
return index >= 0 ? args2[index + 1] : void 0;
|
|
34603
|
+
};
|
|
34604
|
+
const organization = option2("--organization"), app = option2("--app");
|
|
34605
|
+
if (organization !== void 0 && app !== void 0) throw new Error("Choose --app or --organization, not both.");
|
|
34606
|
+
if (organization !== void 0) {
|
|
34607
|
+
if (!guid4.test(organization)) throw new Error("--organization must be a UUID.");
|
|
34608
|
+
return `/organizations/${organization}/suspension`;
|
|
34609
|
+
}
|
|
34610
|
+
const id = app ?? projectApplication2();
|
|
34611
|
+
if (!guid4.test(id)) throw new Error("--app must be a UUID.");
|
|
34612
|
+
return `/apps/${id}/suspension`;
|
|
34613
|
+
}
|
|
34614
|
+
function suspensionLines(notice, portalUrl) {
|
|
34615
|
+
if (!notice) return ["Not suspended."];
|
|
34616
|
+
const appeal = portalLink(portalUrl, notice.appealPath);
|
|
34617
|
+
return [
|
|
34618
|
+
`Backify suspended this ${notice.scope} on ${notice.suspendedAt} (reference ${notice.reference}).`,
|
|
34619
|
+
`Policy: ${notice.categoryLabel}.`,
|
|
34620
|
+
`Reason: ${notice.statementOfReasons}`,
|
|
34621
|
+
notice.scope === "organization" ? "Its applications are not served, deployed or run, and no new applications can be created. Data export and billing still work." : notice.deletionDueAt ? "It is not served on any address and cannot be deployed or changed. Its data can be exported until it is deleted." : "It is not served on any address and cannot be deployed or changed. Its data is kept and can be exported.",
|
|
34622
|
+
...notice.deletionDueAt ? [`Backify terminated it; its data is deleted on or after ${notice.deletionDueAt.slice(0, 10)}.`] : [],
|
|
34623
|
+
appeal ? `Organization owners appeal in the Backify Portal: ${appeal} (appeals cannot be made from the CLI). Alternatively, email ${notice.appealAddress} quoting ${notice.reference}.` : `To appeal, email ${notice.appealAddress} quoting ${notice.reference}.`
|
|
34624
|
+
];
|
|
34625
|
+
}
|
|
34626
|
+
|
|
34627
|
+
// src/decisions.ts
|
|
34628
|
+
var decisionsUsage = [
|
|
34629
|
+
"Use backify decisions [--organization <id>] [--json]:",
|
|
34630
|
+
" Lists Backify's warnings, suspensions and terminations for the organization and its applications from the last year: the policy,",
|
|
34631
|
+
" the reasons, whether each is in force, when data is deleted after a termination, and the appeal status and outcome.",
|
|
34632
|
+
" Appeals cannot be made from the CLI or a coding agent: an organization owner appeals in the Backify Portal (or by email to the",
|
|
34633
|
+
" address shown) within six months. --organization defaults to the signed-in organization."
|
|
34634
|
+
].join("\n");
|
|
34635
|
+
var decisionsPath = (organizationId) => `/organizations/${organizationId}/policy-decisions`;
|
|
34636
|
+
var day2 = (value) => value ? value.slice(0, 10) : "";
|
|
34637
|
+
var actions = { warn: "Warning", suspend: "Suspension", terminate: "Termination" };
|
|
34638
|
+
function appealText(appeal) {
|
|
34639
|
+
if (appeal.status === "open") return `Appeal: submitted ${day2(appeal.submittedAt)}, awaiting Backify's review.`;
|
|
34640
|
+
const outcome = appeal.status === "overturned" ? "overturned (decision lifted)" : appeal.status === "upheld" ? "upheld (decision stands)" : appeal.status;
|
|
34641
|
+
return `Appeal: ${outcome}` + (appeal.decidedAt ? ` on ${day2(appeal.decidedAt)}` : "") + (appeal.decisionReason ? `. Reason: ${appeal.decisionReason}` : ".");
|
|
34642
|
+
}
|
|
34643
|
+
function decisionLines(decision, portalUrl) {
|
|
34644
|
+
const target = decision.scope === "organization" ? "the organization" : `application ${decision.targetName ?? decision.targetId}`;
|
|
34645
|
+
const lines = [
|
|
34646
|
+
`${decision.reference} ${actions[decision.action] ?? decision.action} of ${target}, ${day2(decision.decidedAt)}, ${decision.inForce ? "in force" : "no longer in force"}`,
|
|
34647
|
+
` Policy: ${decision.categoryLabel}`,
|
|
34648
|
+
` Reasons: ${decision.statementOfReasons}`
|
|
34649
|
+
];
|
|
34650
|
+
if (decision.deletionDueAt) lines.push(` Backify terminated it; its data is deleted on or after ${day2(decision.deletionDueAt)}.`);
|
|
34651
|
+
if (decision.appeal) lines.push(" " + appealText(decision.appeal));
|
|
34652
|
+
else if (decision.appealable) {
|
|
34653
|
+
const link = portalLink(portalUrl, decision.appealPath) ?? decision.appealPath;
|
|
34654
|
+
lines.push(` Appeal by ${day2(decision.appealBy)}. Organization owners appeal in the Backify Portal: ${link} (or email ${decision.appealAddress} quoting ${decision.reference}).`);
|
|
34655
|
+
} else lines.push(decision.inForce ? ` Appeal: no longer possible; the appeal period ended ${day2(decision.appealBy)}.` : " Appeal: none; the decision is no longer in force.");
|
|
34656
|
+
return lines;
|
|
34657
|
+
}
|
|
34658
|
+
function decisionsLines(decisions, portalUrl) {
|
|
34659
|
+
if (!decisions?.length) return ["Backify has made no warnings, suspensions or terminations for this organization or its applications in the last year."];
|
|
34660
|
+
return [
|
|
34661
|
+
...decisions.flatMap((decision, index) => [...index ? [""] : [], ...decisionLines(decision, portalUrl)]),
|
|
34662
|
+
"",
|
|
34663
|
+
"Appeals cannot be made from the CLI; an organization owner appeals in the Backify Portal or by email."
|
|
34664
|
+
];
|
|
34665
|
+
}
|
|
34666
|
+
|
|
34530
34667
|
// src/outbound-http.ts
|
|
34531
34668
|
var outboundHttpUsage = [
|
|
34532
34669
|
"Use backify outbound <action> --environment <UUID> [--app <application-id>]:",
|
|
@@ -34539,7 +34676,7 @@ var outboundHttpUsage = [
|
|
|
34539
34676
|
" requests [--search <text>] [--outcome allowed|blocked|not-allowed]",
|
|
34540
34677
|
"List environments with backify events environments. Quote wildcards so your shell does not expand them."
|
|
34541
34678
|
].join("\n");
|
|
34542
|
-
var
|
|
34679
|
+
var guid5 = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
|
|
34543
34680
|
function outboundHttpCall(appId, args2) {
|
|
34544
34681
|
const option2 = (name2) => {
|
|
34545
34682
|
const index = args2.indexOf(name2);
|
|
@@ -34547,7 +34684,7 @@ function outboundHttpCall(appId, args2) {
|
|
|
34547
34684
|
};
|
|
34548
34685
|
const [action, value] = args2;
|
|
34549
34686
|
const environment = option2("--environment");
|
|
34550
|
-
if (!action || !environment || !
|
|
34687
|
+
if (!action || !environment || !guid5.test(environment)) throw new Error(outboundHttpUsage);
|
|
34551
34688
|
const base2 = `/apps/${appId}/outbound-http/environments/${environment}`;
|
|
34552
34689
|
const query = (names) => {
|
|
34553
34690
|
const params = new URLSearchParams();
|
|
@@ -34570,7 +34707,7 @@ function outboundHttpCall(appId, args2) {
|
|
|
34570
34707
|
if (!positional) throw new Error(`Give a host, wildcard or HTTPS URL: backify outbound ${action} <pattern> --environment <UUID>.`);
|
|
34571
34708
|
return { method: "POST", path: base2 + "/rules", body: { pattern: positional, action } };
|
|
34572
34709
|
case "remove":
|
|
34573
|
-
if (!positional || !
|
|
34710
|
+
if (!positional || !guid5.test(positional)) throw new Error("Give the rule ID from backify outbound show: backify outbound remove <rule-id> --environment <UUID>.");
|
|
34574
34711
|
return { method: "DELETE", path: `${base2}/rules/${positional}` };
|
|
34575
34712
|
case "destinations":
|
|
34576
34713
|
return { method: "GET", path: base2 + "/destinations" + query(["search"]) };
|
|
@@ -34585,7 +34722,7 @@ function outboundHttpCall(appId, args2) {
|
|
|
34585
34722
|
}
|
|
34586
34723
|
|
|
34587
34724
|
// src/capability-data.ts
|
|
34588
|
-
var
|
|
34725
|
+
var guid6 = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
|
|
34589
34726
|
var bucketName = /^[a-z0-9](?:[a-z0-9-]{1,61}[a-z0-9])$/;
|
|
34590
34727
|
function reader(args2) {
|
|
34591
34728
|
const option2 = (name2) => {
|
|
@@ -34607,7 +34744,7 @@ function reader(args2) {
|
|
|
34607
34744
|
}
|
|
34608
34745
|
function environmentOf(args2, usage) {
|
|
34609
34746
|
const environment = reader(args2).option("--environment");
|
|
34610
|
-
if (!environment || !
|
|
34747
|
+
if (!environment || !guid6.test(environment)) throw new Error(usage);
|
|
34611
34748
|
return environment;
|
|
34612
34749
|
}
|
|
34613
34750
|
var storageUsage = [
|
|
@@ -35073,6 +35210,9 @@ var help = [
|
|
|
35073
35210
|
"Setup: init | sync | doctor [--environment] | upgrade [--json]",
|
|
35074
35211
|
"Account: signup [--name <organization>] [--plan <plan>] | login | logout | connect | disconnect | status | apps",
|
|
35075
35212
|
" notifications [list [--action|--unread] | summary | read <id>|--all | dismiss <id> | preferences [set <category> --email on|off|default --in-app on|off|default]] (backify notifications --help)",
|
|
35213
|
+
" suspension [--app <id> | --organization <id>] [--json] whether Backify suspended it, why, and where to appeal",
|
|
35214
|
+
" decisions [--organization <id>] [--json] Backify's warnings, suspensions and terminations with appeal status (owners appeal in the Portal, not the CLI)",
|
|
35215
|
+
" legal [--organization <id>] [--json] [--open] accepted Terms of Service version and any deadline (owners accept in the Portal, not the CLI)",
|
|
35076
35216
|
"Coding: tools configure --agent <tool> [--transport http|stdio] [--config <path>] [--dry-run] | mcp [--organization <organization-id>]",
|
|
35077
35217
|
"Org admin: ops search [<query>] | ops describe <operation-id> | ops get|run <operation-id> [--param <name>=<value>] [--body <file>] [--yes] [--organization <id>] [--json]",
|
|
35078
35218
|
"SSO: sso [guide <provider> | connections add|update|remove | test|on|off|sign-ins <connection-id> | domains | require|unrequire <domain-id> | break-glass | group-sync | mappings | scim] (backify sso --help)",
|
|
@@ -35549,6 +35689,19 @@ Next: ${here ? "" : `cd ${directory} && `}npm install && npm run dev`);
|
|
|
35549
35689
|
process.exitCode = 1;
|
|
35550
35690
|
break;
|
|
35551
35691
|
}
|
|
35692
|
+
const suspension = await call(prefix + "/suspension");
|
|
35693
|
+
if (suspension) {
|
|
35694
|
+
console.log(JSON.stringify({ suspension: { ...suspension, appealUrl: portalLink(authUrl, suspension.appealPath) } }, null, 2));
|
|
35695
|
+
process.exitCode = 1;
|
|
35696
|
+
}
|
|
35697
|
+
try {
|
|
35698
|
+
const legal = legalStatusSummary(await call(legalPath(organizationTarget([], () => callCredential().credential.organizationId))), authUrl);
|
|
35699
|
+
if (legal) {
|
|
35700
|
+
console.log(legal.message);
|
|
35701
|
+
console.log(JSON.stringify({ legal }, null, 2));
|
|
35702
|
+
}
|
|
35703
|
+
} catch {
|
|
35704
|
+
}
|
|
35552
35705
|
console.log(JSON.stringify(await call(prefix + "/developer"), null, 2));
|
|
35553
35706
|
const deployments = await call(prefix + "/deployments");
|
|
35554
35707
|
const latest = deployments[0];
|
|
@@ -35782,6 +35935,42 @@ Next: ${here ? "" : `cd ${directory} && `}npm install && npm run dev`);
|
|
|
35782
35935
|
console.log(JSON.stringify(await call(request.path), null, 2));
|
|
35783
35936
|
break;
|
|
35784
35937
|
}
|
|
35938
|
+
case "suspension": {
|
|
35939
|
+
if (args.includes("--help")) {
|
|
35940
|
+
console.log(suspensionUsage);
|
|
35941
|
+
break;
|
|
35942
|
+
}
|
|
35943
|
+
const notice = await call(suspensionPath(args, projectApplication));
|
|
35944
|
+
if (args.includes("--json")) console.log(JSON.stringify(notice ?? { suspended: false }, null, 2));
|
|
35945
|
+
else for (const line2 of suspensionLines(notice, authUrl)) console.log(line2);
|
|
35946
|
+
if (notice) process.exitCode = 1;
|
|
35947
|
+
break;
|
|
35948
|
+
}
|
|
35949
|
+
case "legal": {
|
|
35950
|
+
if (args.includes("--help")) {
|
|
35951
|
+
console.log(legalUsage);
|
|
35952
|
+
break;
|
|
35953
|
+
}
|
|
35954
|
+
const status = await call(legalPath(organizationTarget(args, () => callCredential().credential.organizationId)));
|
|
35955
|
+
if (args.includes("--json")) console.log(JSON.stringify(status, null, 2));
|
|
35956
|
+
else for (const line2 of legalLines(status, authUrl)) console.log(line2);
|
|
35957
|
+
if (args.includes("--open")) {
|
|
35958
|
+
const link = portalLink(authUrl, status.acceptPath);
|
|
35959
|
+
if (link) openBrowser(link);
|
|
35960
|
+
else console.error("The Portal address is not a trusted HTTPS origin, so the page was not opened. Open it in the Backify Portal manually.");
|
|
35961
|
+
}
|
|
35962
|
+
break;
|
|
35963
|
+
}
|
|
35964
|
+
case "decisions": {
|
|
35965
|
+
if (args.includes("--help")) {
|
|
35966
|
+
console.log(decisionsUsage);
|
|
35967
|
+
break;
|
|
35968
|
+
}
|
|
35969
|
+
const decisions = await call(decisionsPath(organizationTarget(args, () => callCredential().credential.organizationId)));
|
|
35970
|
+
if (args.includes("--json")) console.log(JSON.stringify(decisions, null, 2));
|
|
35971
|
+
else for (const line2 of decisionsLines(decisions, authUrl)) console.log(line2);
|
|
35972
|
+
break;
|
|
35973
|
+
}
|
|
35785
35974
|
case "notifications": {
|
|
35786
35975
|
if (args.includes("--help")) {
|
|
35787
35976
|
console.log(notificationsUsage);
|
|
@@ -35904,6 +36093,8 @@ main().catch((error2) => {
|
|
|
35904
36093
|
const address = process.env.BACKIFY_API_URL ?? userConfig.apiUrl ?? "https://api.backify.dev/api";
|
|
35905
36094
|
message = `Cannot reach the Backify API at ${address}. Check connectivity` + (process.env.BACKIFY_API_URL ? ", or the BACKIFY_API_URL override." : userConfig.apiUrl ? `, or the apiUrl saved in ${configPath} (backify login --api https://api.backify.dev/api resets it).` : ".");
|
|
35906
36095
|
}
|
|
36096
|
+
const legalHint = legalErrorHint(message);
|
|
36097
|
+
if (legalHint) message += "\n" + legalHint;
|
|
35907
36098
|
if (command !== "mcp" && args.includes("--json")) console.log(JSON.stringify({ schemaVersion: 1, status: "failed", exitCode: 1, error: message, ...error2 instanceof CliAuthenticationRequired ? { code: error2.code, reauthenticationCommand: "backify connect --reauth" + (option("--app") ? " --app " + applicationGuid(option("--app")) : "") } : {} }));
|
|
35908
36099
|
else console.error(message);
|
|
35909
36100
|
process.exitCode = 1;
|