deepline 0.3.350 → 0.3.351
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/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +47 -22
- package/dist/cli/{auth-7X3G2MCE.mjs → auth-NQLQ5QBV.mjs} +4 -4
- package/dist/cli/auth-YTDZKDCB.js +31 -0
- package/dist/cli/{billing-DOVYL5TT.mjs → billing-AXSNXOTN.mjs} +4 -4
- package/dist/cli/{billing-2J4WREAL.js → billing-AZCBAJ6Q.js} +73 -73
- package/dist/cli/{chunk-H4MOKDCV.mjs → chunk-722274AA.mjs} +1 -1
- package/dist/cli/{chunk-UKOXXA75.js → chunk-73J3BGJ3.js} +60 -60
- package/dist/cli/{chunk-LDILBDLL.mjs → chunk-7BGGBA4V.mjs} +4 -4
- package/dist/cli/{chunk-2COBRUUH.js → chunk-7ZAG2XG5.js} +6 -6
- package/dist/cli/{chunk-2Z6HV7BK.mjs → chunk-AQQFVUDI.mjs} +2 -2
- package/dist/cli/{chunk-LE7DZZVE.js → chunk-BKOYPUK2.js} +26 -26
- package/dist/cli/{chunk-IHMNFNL3.js → chunk-BOOZ7D7V.js} +225 -225
- package/dist/cli/{chunk-CYCJBDW6.mjs → chunk-BR3XFSXN.mjs} +6 -6
- package/dist/cli/{chunk-AWJ2A2CP.js → chunk-BWFUBETD.js} +48 -48
- package/dist/cli/{chunk-WWJOE6JQ.mjs → chunk-CFALTV4O.mjs} +2 -2
- package/dist/cli/{chunk-36MFVS4Q.js → chunk-CIDP2FSO.js} +9 -9
- package/dist/cli/{chunk-5ZFDADDM.mjs → chunk-DBWASDYS.mjs} +3 -3
- package/dist/cli/{chunk-4ODBHH6X.mjs → chunk-GT5HPOM3.mjs} +1 -1
- package/dist/cli/{chunk-FYZFB2CS.mjs → chunk-H5JUSKHB.mjs} +1 -1
- package/dist/cli/{chunk-NWN23EZM.js → chunk-ICZTTYDS.js} +8 -8
- package/dist/cli/{chunk-VC7D7OXL.mjs → chunk-IKC7EPDS.mjs} +1 -1
- package/dist/cli/{chunk-Z5RG3AOP.js → chunk-JV6GFIQQ.js} +45 -45
- package/dist/cli/{chunk-GMOMXQR6.js → chunk-L7YXXM5W.js} +1 -1
- package/dist/cli/{chunk-ZIUELPGR.js → chunk-NUD2WO3E.js} +4 -4
- package/dist/cli/{chunk-2NI75UNO.mjs → chunk-OF4N5X7Z.mjs} +2 -2
- package/dist/cli/{chunk-FUQQ3U62.js → chunk-QD7W3OBA.js} +8 -8
- package/dist/cli/{chunk-2KLYUZI7.mjs → chunk-QOYD2THS.mjs} +2 -2
- package/dist/cli/{chunk-QMMMMGAB.js → chunk-SDLFAGQS.js} +15 -15
- package/dist/cli/{chunk-TFGKO7XG.mjs → chunk-URBPUPJS.mjs} +5 -5
- package/dist/cli/{chunk-YCBWMF2O.js → chunk-WY5N3SSC.js} +2 -2
- package/dist/cli/{chunk-NZMVPYBQ.mjs → chunk-XFTGWGZ5.mjs} +1 -1
- package/dist/cli/client-3GCQER5K.js +20 -0
- package/dist/cli/{client-YM7EV7JZ.mjs → client-NTEDBLQK.mjs} +3 -3
- package/dist/cli/{csv-3CE5IY4L.js → csv-6PZZ4ARC.js} +12 -12
- package/dist/cli/{csv-IERAXUNG.mjs → csv-SSSPKSKU.mjs} +3 -3
- package/dist/cli/{db-VYSLD53P.js → db-3YL7YWTM.js} +29 -29
- package/dist/cli/{db-M2ONKJRD.mjs → db-XEVVDWOP.mjs} +4 -4
- package/dist/cli/{describe-2XFXS2SX.js → describe-XZNQXFXD.js} +15 -15
- package/dist/cli/{describe-W6FCAXZR.mjs → describe-YZ365BKT.mjs} +8 -8
- package/dist/cli/{executions-P7EK3RC7.js → executions-WBTIT2RU.js} +6 -6
- package/dist/cli/{executions-OUP6IVMO.mjs → executions-ZAV7YCQC.mjs} +4 -4
- package/dist/cli/{feedback-Q5QTIZSG.mjs → feedback-NOYG63QE.mjs} +3 -3
- package/dist/cli/{feedback-UHG2PISO.js → feedback-PRVJ26X7.js} +7 -7
- package/dist/cli/{git-DMG3Z36A.mjs → git-AOSMM4US.mjs} +4 -4
- package/dist/cli/git-ZI4H72YR.js +23 -0
- package/dist/cli/index.js +79 -79
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-DZJRLQUN.js → legacy-noops-RTNAEYVF.js} +7 -7
- package/dist/cli/{legacy-noops-ARAPGQUN.mjs → legacy-noops-T6DKTGZY.mjs} +4 -4
- package/dist/cli/{monitors-B7HLL45A.js → monitors-7ERJ4277.js} +85 -85
- package/dist/cli/{monitors-7GSSQILT.mjs → monitors-QIR3T2QR.mjs} +4 -4
- package/dist/cli/{org-VIY2LH6L.js → org-7P46IVVU.js} +60 -60
- package/dist/cli/{org-UR72VY3A.mjs → org-WNRQQZNP.mjs} +4 -4
- package/dist/cli/{play-ATTKGZLK.mjs → play-57XTHKER.mjs} +7 -7
- package/dist/cli/play-QIX7RZ74.js +153 -0
- package/dist/cli/{providers-ZBZED4TK.mjs → providers-ET6UBGWJ.mjs} +4 -4
- package/dist/cli/{providers-RDOEU4FO.js → providers-USRX4UVZ.js} +7 -7
- package/dist/cli/{quickstart-Y2GPRMC7.js → quickstart-BPPQFMWI.js} +5 -5
- package/dist/cli/{quickstart-JT5FW7EB.mjs → quickstart-OGZ7BZKS.mjs} +3 -3
- package/dist/cli/{search-73OTM3ZZ.mjs → search-MZARI5XA.mjs} +5 -5
- package/dist/cli/search-P447HWLU.js +26 -0
- package/dist/cli/{secrets-EEXG43XS.js → secrets-O6XG35SA.js} +13 -13
- package/dist/cli/{secrets-AHDWUIVL.mjs → secrets-WMUJ6PB4.mjs} +4 -4
- package/dist/cli/{sessions-LDZMTST4.mjs → sessions-EYALESPC.mjs} +4 -4
- package/dist/cli/{sessions-SHSSRPN5.js → sessions-LCHVGXMV.js} +5 -5
- package/dist/cli/{settings-FMM4KYDS.js → settings-25YT2IQK.js} +74 -74
- package/dist/cli/{settings-JBCSG3JV.mjs → settings-LUGKMDDX.mjs} +7 -7
- package/dist/cli/{setup-VF3WHT2K.js → setup-AKZWHNKU.js} +41 -41
- package/dist/cli/{setup-4M6GZEV6.mjs → setup-KSRA3V42.mjs} +6 -6
- package/dist/cli/skills-GYWMMOFQ.js +28 -0
- package/dist/cli/{skills-5GSHPGQR.mjs → skills-VJJIB4F5.mjs} +4 -4
- package/dist/cli/tools-HN6E2AH6.js +40 -0
- package/dist/cli/{tools-7G6TW3MO.mjs → tools-NYQD3VSU.mjs} +6 -6
- package/dist/cli/{update-NY2LA7HX.mjs → update-GU4TALAI.mjs} +6 -6
- package/dist/cli/update-IIEKVC75.js +28 -0
- package/dist/cli/{workflow-JPNJ5D2W.mjs → workflow-T4VNPJA4.mjs} +5 -5
- package/dist/cli/{workflow-TZ4UU3MV.js → workflow-TFOUWNEJ.js} +15 -15
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +74 -74
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-CYXUWRLU.js +0 -31
- package/dist/cli/client-R4VF7KSK.js +0 -20
- package/dist/cli/git-IQRVNMQL.js +0 -23
- package/dist/cli/play-FT7EUE2Y.js +0 -153
- package/dist/cli/search-LHD6BP42.js +0 -26
- package/dist/cli/skills-RKY6BV2Y.js +0 -28
- package/dist/cli/tools-RSVWPCZT.js +0 -40
- package/dist/cli/update-ZD7UN6FA.js +0 -28
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkCIDP2FSOjs = require('./chunk-CIDP2FSO.js');
|
|
6
6
|
require('./chunk-LA46MMTL.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -10,13 +10,13 @@ require('./chunk-LA46MMTL.js');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk7ZAG2XG5js = require('./chunk-7ZAG2XG5.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkNUD2WO3Ejs = require('./chunk-NUD2WO3E.js');
|
|
18
18
|
require('./chunk-XNYIZMNQ.js');
|
|
19
|
-
require('./chunk-
|
|
19
|
+
require('./chunk-L7YXXM5W.js');
|
|
20
20
|
require('./chunk-S6R3OX7B.js');
|
|
21
21
|
|
|
22
22
|
|
|
@@ -35,7 +35,7 @@ var SUBSCRIPTION_CANCEL_PATH = "/api/v2/billing/subscription/cancel";
|
|
|
35
35
|
var BILLING_TOP_UP_PATH = "/api/v2/billing/top-up";
|
|
36
36
|
var DEFAULT_BALANCE_RECOVERY_CREDITS = 100;
|
|
37
37
|
function billingFailureFromError(error, options) {
|
|
38
|
-
if (error instanceof
|
|
38
|
+
if (error instanceof _chunkNUD2WO3Ejs.AuthError) {
|
|
39
39
|
return {
|
|
40
40
|
exitCode: 3,
|
|
41
41
|
code: "AUTH_ERROR",
|
|
@@ -69,7 +69,7 @@ function reportBillingFailure(failure, options) {
|
|
|
69
69
|
if (failure.next) {
|
|
70
70
|
textLines.push(`Next: ${failure.next}`);
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
73
73
|
{
|
|
74
74
|
ok: false,
|
|
75
75
|
exitCode: failure.exitCode,
|
|
@@ -90,7 +90,7 @@ function parseTopUpCredits(raw) {
|
|
|
90
90
|
return parsed;
|
|
91
91
|
}
|
|
92
92
|
function topUpIdempotencyKey(raw) {
|
|
93
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
93
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkCIDP2FSOjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
94
94
|
}
|
|
95
95
|
function targetBillingIdempotencyKey(raw) {
|
|
96
96
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -127,7 +127,7 @@ function apiErrorCode(error) {
|
|
|
127
127
|
return _nullishCoalesce(error.code, () => ( "BILLING_API_ERROR"));
|
|
128
128
|
}
|
|
129
129
|
function billingTopUpFailureFromError(error, input) {
|
|
130
|
-
if (error instanceof
|
|
130
|
+
if (error instanceof _chunkNUD2WO3Ejs.AuthError || error instanceof _chunkNUD2WO3Ejs.ConfigError) {
|
|
131
131
|
return {
|
|
132
132
|
exitCode: 3,
|
|
133
133
|
code: "AUTH_ERROR",
|
|
@@ -296,7 +296,7 @@ function defaultLedgerExportPath() {
|
|
|
296
296
|
);
|
|
297
297
|
}
|
|
298
298
|
async function handleBalance(options) {
|
|
299
|
-
const { http } =
|
|
299
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
300
300
|
const payload = await http.get(
|
|
301
301
|
"/api/v2/billing/balance"
|
|
302
302
|
);
|
|
@@ -364,7 +364,7 @@ async function handleBalance(options) {
|
|
|
364
364
|
...options.verbose ? detail : [],
|
|
365
365
|
...lines.slice(1)
|
|
366
366
|
];
|
|
367
|
-
|
|
367
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
368
368
|
{
|
|
369
369
|
...payload,
|
|
370
370
|
...recovery ? { recovery } : {},
|
|
@@ -388,7 +388,7 @@ function quoteShellArgument(value) {
|
|
|
388
388
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
389
389
|
}
|
|
390
390
|
async function handleUsage(options) {
|
|
391
|
-
const { http } =
|
|
391
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
392
392
|
const params = new URLSearchParams();
|
|
393
393
|
if (options.requestId !== void 0) {
|
|
394
394
|
const requestId = options.requestId.trim();
|
|
@@ -469,7 +469,7 @@ async function handleUsage(options) {
|
|
|
469
469
|
"No continuation is available for this view. Use deepline billing ledger export all --json for the full ledger."
|
|
470
470
|
] : []
|
|
471
471
|
];
|
|
472
|
-
|
|
472
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
473
473
|
{
|
|
474
474
|
...payload,
|
|
475
475
|
recent: {
|
|
@@ -483,7 +483,7 @@ async function handleUsage(options) {
|
|
|
483
483
|
);
|
|
484
484
|
}
|
|
485
485
|
async function handleLimit(options) {
|
|
486
|
-
const { http } =
|
|
486
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
487
487
|
const payload = await http.get(
|
|
488
488
|
"/api/v2/billing/limit"
|
|
489
489
|
);
|
|
@@ -491,7 +491,7 @@ async function handleLimit(options) {
|
|
|
491
491
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
492
492
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
493
493
|
] : ["Monthly usage cap: off"];
|
|
494
|
-
|
|
494
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
495
495
|
{
|
|
496
496
|
...payload,
|
|
497
497
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -500,12 +500,12 @@ async function handleLimit(options) {
|
|
|
500
500
|
);
|
|
501
501
|
}
|
|
502
502
|
async function handleSetLimit(credits, options) {
|
|
503
|
-
const { http } =
|
|
503
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
504
504
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
505
505
|
method: "PUT",
|
|
506
506
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
507
507
|
});
|
|
508
|
-
|
|
508
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
509
509
|
{
|
|
510
510
|
...payload,
|
|
511
511
|
render: {
|
|
@@ -521,11 +521,11 @@ async function handleSetLimit(credits, options) {
|
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
523
|
async function handleLimitOff(options) {
|
|
524
|
-
const { http } =
|
|
524
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
525
525
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
526
526
|
method: "DELETE"
|
|
527
527
|
});
|
|
528
|
-
|
|
528
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
529
529
|
{
|
|
530
530
|
...payload,
|
|
531
531
|
render: {
|
|
@@ -545,7 +545,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
545
545
|
let initialized = false;
|
|
546
546
|
let pageNumber = 0;
|
|
547
547
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
548
|
-
for await (const entries of
|
|
548
|
+
for await (const entries of _chunkCIDP2FSOjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
549
549
|
pageNumber += 1;
|
|
550
550
|
console.error(
|
|
551
551
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -584,7 +584,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
584
584
|
return summary;
|
|
585
585
|
}
|
|
586
586
|
async function handleHistory(options) {
|
|
587
|
-
const { http } =
|
|
587
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
588
588
|
const windows = {
|
|
589
589
|
"1d": 86400,
|
|
590
590
|
"1w": 604800,
|
|
@@ -596,10 +596,10 @@ async function handleHistory(options) {
|
|
|
596
596
|
process.cwd(),
|
|
597
597
|
"deepline",
|
|
598
598
|
"data",
|
|
599
|
-
|
|
599
|
+
_chunk7ZAG2XG5js.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
600
600
|
);
|
|
601
601
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
602
|
-
|
|
602
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
603
603
|
{
|
|
604
604
|
output_path: outputPath,
|
|
605
605
|
row_count: summary.row_count,
|
|
@@ -636,14 +636,14 @@ async function handleLedgerExportAll(options) {
|
|
|
636
636
|
);
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
|
-
const { http } =
|
|
639
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
640
640
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
641
641
|
const summary = await exportLedger(http, outputPath, {
|
|
642
642
|
sinceAt,
|
|
643
643
|
runId: options.runId,
|
|
644
644
|
operation: options.operation
|
|
645
645
|
});
|
|
646
|
-
|
|
646
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
647
647
|
{
|
|
648
648
|
output_path: outputPath,
|
|
649
649
|
row_count: summary.row_count,
|
|
@@ -682,7 +682,7 @@ function targetPlanLine(plan) {
|
|
|
682
682
|
return `${plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
|
|
683
683
|
}
|
|
684
684
|
async function handlePlans(options) {
|
|
685
|
-
const client = new (0,
|
|
685
|
+
const client = new (0, _chunkCIDP2FSOjs.DeeplineClient)();
|
|
686
686
|
const payload = await client.billing.targetPlans();
|
|
687
687
|
const listedCurrentPlan = payload.plans.find(
|
|
688
688
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -695,8 +695,8 @@ async function handlePlans(options) {
|
|
|
695
695
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
696
696
|
"Change plan: deepline billing change-plan <plan_sku> --json"
|
|
697
697
|
];
|
|
698
|
-
const legacyPayload =
|
|
699
|
-
|
|
698
|
+
const legacyPayload = _chunk7ZAG2XG5js.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
699
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
700
700
|
{
|
|
701
701
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
702
702
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -706,7 +706,7 @@ async function handlePlans(options) {
|
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
708
|
async function handleSubscribe(planVersionId, options) {
|
|
709
|
-
const { http } =
|
|
709
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
710
710
|
const payload = await http.request(
|
|
711
711
|
"/api/v2/billing/subscription/checkout",
|
|
712
712
|
{
|
|
@@ -715,8 +715,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
715
715
|
}
|
|
716
716
|
);
|
|
717
717
|
const url = String(payload.checkout_url || "");
|
|
718
|
-
if (!options.json && options.open !== false && url)
|
|
719
|
-
|
|
718
|
+
if (!options.json && options.open !== false && url) _chunk7ZAG2XG5js.openInBrowser.call(void 0, url);
|
|
719
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
720
720
|
{
|
|
721
721
|
...payload,
|
|
722
722
|
render: {
|
|
@@ -732,7 +732,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
732
732
|
);
|
|
733
733
|
}
|
|
734
734
|
async function handleSubscriptionStatus(options) {
|
|
735
|
-
const client = new (0,
|
|
735
|
+
const client = new (0, _chunkCIDP2FSOjs.DeeplineClient)();
|
|
736
736
|
const payload = await client.billing.subscription.status();
|
|
737
737
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
738
738
|
const lines = [
|
|
@@ -752,7 +752,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
752
752
|
],
|
|
753
753
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
754
754
|
];
|
|
755
|
-
|
|
755
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
756
756
|
{
|
|
757
757
|
...payload,
|
|
758
758
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -761,7 +761,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
761
761
|
);
|
|
762
762
|
}
|
|
763
763
|
async function handleSubscriptionCancel(options) {
|
|
764
|
-
const client = new (0,
|
|
764
|
+
const client = new (0, _chunkCIDP2FSOjs.DeeplineClient)();
|
|
765
765
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
766
766
|
if (options.dryRun) {
|
|
767
767
|
const status = await client.billing.subscription.status();
|
|
@@ -778,7 +778,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
780
|
const consequence = action === "cancel" ? `Would schedule cancellation at period end${status.current_period_end ? ` (${status.current_period_end})` : ""}. The subscription stays active until then and remaining credits are kept.` : "Would reverse the pending cancellation; the subscription would renew normally.";
|
|
781
|
-
|
|
781
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
782
782
|
{
|
|
783
783
|
ok: true,
|
|
784
784
|
dry_run: true,
|
|
@@ -833,7 +833,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
833
833
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
834
834
|
"Undo with: deepline billing subscription cancel --undo"
|
|
835
835
|
];
|
|
836
|
-
|
|
836
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
837
837
|
{
|
|
838
838
|
ok: true,
|
|
839
839
|
...result,
|
|
@@ -887,7 +887,7 @@ async function handleInvoices(options) {
|
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
const client = new (0,
|
|
890
|
+
const client = new (0, _chunkCIDP2FSOjs.DeeplineClient)();
|
|
891
891
|
let payload;
|
|
892
892
|
try {
|
|
893
893
|
payload = await client.billing.invoices.list(
|
|
@@ -916,7 +916,7 @@ async function handleInvoices(options) {
|
|
|
916
916
|
url: entry.url
|
|
917
917
|
}))
|
|
918
918
|
} : { ...payload, count: entries.length };
|
|
919
|
-
|
|
919
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
920
920
|
{
|
|
921
921
|
...envelope,
|
|
922
922
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -925,7 +925,7 @@ async function handleInvoices(options) {
|
|
|
925
925
|
);
|
|
926
926
|
}
|
|
927
927
|
async function handleCheckout(options) {
|
|
928
|
-
const { http } =
|
|
928
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
929
929
|
const payload = await http.post(
|
|
930
930
|
"/api/v2/billing/checkout",
|
|
931
931
|
{
|
|
@@ -935,8 +935,8 @@ async function handleCheckout(options) {
|
|
|
935
935
|
}
|
|
936
936
|
);
|
|
937
937
|
const url = String(payload.url || payload.checkout_url || "");
|
|
938
|
-
if (!options.json && !options.noOpen && url)
|
|
939
|
-
|
|
938
|
+
if (!options.json && !options.noOpen && url) _chunk7ZAG2XG5js.openInBrowser.call(void 0, url);
|
|
939
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
940
940
|
{
|
|
941
941
|
...payload,
|
|
942
942
|
render: {
|
|
@@ -981,7 +981,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
981
981
|
return;
|
|
982
982
|
}
|
|
983
983
|
if (options.dryRun) {
|
|
984
|
-
|
|
984
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
985
985
|
{
|
|
986
986
|
ok: true,
|
|
987
987
|
dry_run: true,
|
|
@@ -1011,7 +1011,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1011
1011
|
);
|
|
1012
1012
|
return;
|
|
1013
1013
|
}
|
|
1014
|
-
const client = new (0,
|
|
1014
|
+
const client = new (0, _chunkCIDP2FSOjs.DeeplineClient)();
|
|
1015
1015
|
let payload;
|
|
1016
1016
|
try {
|
|
1017
1017
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1028,7 +1028,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
1030
|
if (payload.status === "pending") {
|
|
1031
|
-
|
|
1031
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1032
1032
|
{
|
|
1033
1033
|
ok: true,
|
|
1034
1034
|
...payload,
|
|
@@ -1092,17 +1092,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1092
1092
|
]
|
|
1093
1093
|
}
|
|
1094
1094
|
};
|
|
1095
|
-
|
|
1095
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1096
1096
|
json: options.json
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
1099
|
async function handleTargetStatus(options) {
|
|
1100
|
-
const client = new (0,
|
|
1100
|
+
const client = new (0, _chunkCIDP2FSOjs.DeeplineClient)();
|
|
1101
1101
|
const payload = await client.billing.targetStatus();
|
|
1102
1102
|
const balanceCommand = "deepline billing balance --json";
|
|
1103
1103
|
const recentChargesCommand = "deepline billing usage --limit 5 --json";
|
|
1104
1104
|
const exactChargeCommand = "deepline billing usage --request-id <job_id> --json";
|
|
1105
|
-
|
|
1105
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1106
1106
|
{
|
|
1107
1107
|
ok: true,
|
|
1108
1108
|
...payload,
|
|
@@ -1132,8 +1132,8 @@ async function handleTargetStatus(options) {
|
|
|
1132
1132
|
);
|
|
1133
1133
|
}
|
|
1134
1134
|
async function handleEntitlements(options) {
|
|
1135
|
-
const payload = await new (0,
|
|
1136
|
-
|
|
1135
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.entitlements();
|
|
1136
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1137
1137
|
{
|
|
1138
1138
|
ok: true,
|
|
1139
1139
|
...payload,
|
|
@@ -1158,7 +1158,7 @@ async function handleEntitlements(options) {
|
|
|
1158
1158
|
);
|
|
1159
1159
|
}
|
|
1160
1160
|
async function handleAutoRechargeStatus(options) {
|
|
1161
|
-
const payload = await new (0,
|
|
1161
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1162
1162
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1163
1163
|
const lines = [
|
|
1164
1164
|
`State: ${state}`,
|
|
@@ -1168,7 +1168,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1168
1168
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1169
1169
|
] : []
|
|
1170
1170
|
];
|
|
1171
|
-
|
|
1171
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1172
1172
|
{
|
|
1173
1173
|
ok: true,
|
|
1174
1174
|
...payload,
|
|
@@ -1217,7 +1217,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1219
1219
|
if (options.dryRun) {
|
|
1220
|
-
|
|
1220
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1221
1221
|
{
|
|
1222
1222
|
ok: true,
|
|
1223
1223
|
dry_run: true,
|
|
@@ -1238,7 +1238,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1238
1238
|
);
|
|
1239
1239
|
return;
|
|
1240
1240
|
}
|
|
1241
|
-
const payload = await new (0,
|
|
1241
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1242
1242
|
enabled: true,
|
|
1243
1243
|
thresholdCredits,
|
|
1244
1244
|
refillToCredits,
|
|
@@ -1246,7 +1246,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1246
1246
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1247
1247
|
idempotencyKey
|
|
1248
1248
|
});
|
|
1249
|
-
|
|
1249
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1250
1250
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1251
1251
|
{ json: options.json }
|
|
1252
1252
|
);
|
|
@@ -1254,7 +1254,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1254
1254
|
async function handleAutoRechargeOff(options) {
|
|
1255
1255
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1256
1256
|
if (options.dryRun) {
|
|
1257
|
-
|
|
1257
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1258
1258
|
{
|
|
1259
1259
|
ok: true,
|
|
1260
1260
|
dry_run: true,
|
|
@@ -1269,11 +1269,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1269
1269
|
);
|
|
1270
1270
|
return;
|
|
1271
1271
|
}
|
|
1272
|
-
const payload = await new (0,
|
|
1272
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1273
1273
|
enabled: false,
|
|
1274
1274
|
idempotencyKey
|
|
1275
1275
|
});
|
|
1276
|
-
|
|
1276
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1277
1277
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1278
1278
|
{ json: options.json }
|
|
1279
1279
|
);
|
|
@@ -1292,11 +1292,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1292
1292
|
return;
|
|
1293
1293
|
}
|
|
1294
1294
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1295
|
-
const payload = await new (0,
|
|
1295
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.purchaseCredits({
|
|
1296
1296
|
credits,
|
|
1297
1297
|
idempotencyKey
|
|
1298
1298
|
});
|
|
1299
|
-
|
|
1299
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1300
1300
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1301
1301
|
{ json: options.json }
|
|
1302
1302
|
);
|
|
@@ -1332,7 +1332,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1332
1332
|
return;
|
|
1333
1333
|
}
|
|
1334
1334
|
if (options.dryRun) {
|
|
1335
|
-
|
|
1335
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1336
1336
|
{
|
|
1337
1337
|
ok: true,
|
|
1338
1338
|
dry_run: true,
|
|
@@ -1345,12 +1345,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1345
1345
|
);
|
|
1346
1346
|
return;
|
|
1347
1347
|
}
|
|
1348
|
-
const payload = await new (0,
|
|
1348
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1349
1349
|
credits,
|
|
1350
1350
|
orgId: options.orgId,
|
|
1351
1351
|
idempotencyKey: options.idempotencyKey
|
|
1352
1352
|
});
|
|
1353
|
-
|
|
1353
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1354
1354
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1355
1355
|
{ json: options.json }
|
|
1356
1356
|
);
|
|
@@ -1370,37 +1370,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1370
1370
|
return;
|
|
1371
1371
|
}
|
|
1372
1372
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1373
|
-
const payload = await new (0,
|
|
1373
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.transitionPlan({
|
|
1374
1374
|
action: "start_or_change",
|
|
1375
1375
|
targetPlanSku: planSku,
|
|
1376
1376
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1377
1377
|
idempotencyKey
|
|
1378
1378
|
});
|
|
1379
|
-
|
|
1379
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1380
1380
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1381
1381
|
{ json: options.json }
|
|
1382
1382
|
);
|
|
1383
1383
|
}
|
|
1384
1384
|
async function handleTargetPlanCancellation(options) {
|
|
1385
1385
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1386
|
-
const payload = await new (0,
|
|
1386
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.transitionPlan({
|
|
1387
1387
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1388
1388
|
idempotencyKey
|
|
1389
1389
|
});
|
|
1390
|
-
|
|
1390
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1391
1391
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1392
1392
|
{ json: options.json }
|
|
1393
1393
|
);
|
|
1394
1394
|
}
|
|
1395
1395
|
async function handleTargetPortal(options) {
|
|
1396
|
-
const payload = await new (0,
|
|
1396
|
+
const payload = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.portalSession(
|
|
1397
1397
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1398
1398
|
);
|
|
1399
|
-
if (!options.json && !options.noOpen)
|
|
1400
|
-
|
|
1399
|
+
if (!options.json && !options.noOpen) _chunk7ZAG2XG5js.openInBrowser.call(void 0, payload.url);
|
|
1400
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1401
1401
|
}
|
|
1402
1402
|
async function handleRedeemCode(code, options) {
|
|
1403
|
-
const { http } =
|
|
1403
|
+
const { http } = _chunk7ZAG2XG5js.getAuthedHttpClient.call(void 0, );
|
|
1404
1404
|
const payload = await http.post(
|
|
1405
1405
|
"/api/v2/billing/checkout",
|
|
1406
1406
|
{
|
|
@@ -1408,8 +1408,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
);
|
|
1410
1410
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1411
|
-
if (!options.json && !options.noOpen && url)
|
|
1412
|
-
|
|
1411
|
+
if (!options.json && !options.noOpen && url) _chunk7ZAG2XG5js.openInBrowser.call(void 0, url);
|
|
1412
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0,
|
|
1413
1413
|
{
|
|
1414
1414
|
...payload,
|
|
1415
1415
|
render: {
|
|
@@ -1679,8 +1679,8 @@ Examples:
|
|
|
1679
1679
|
new (0, _commander.Command)("trigger").description(
|
|
1680
1680
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1681
1681
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1682
|
-
const result = await new (0,
|
|
1683
|
-
|
|
1682
|
+
const result = await new (0, _chunkCIDP2FSOjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1683
|
+
_chunk7ZAG2XG5js.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1684
1684
|
})
|
|
1685
1685
|
);
|
|
1686
1686
|
billing.command("change-plan").description("Start or change the target billing plan.").argument("<plan_sku>", "payg-v1, builder-v1, growth-v1, or team-v1").option(
|