deepline 0.3.437 → 0.3.439
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/client.ts +23 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +19 -0
- package/dist/cli/auth-5UUDH4A7.js +40 -0
- package/dist/cli/{auth-TSUA536O.mjs → auth-FE2LP7A5.mjs} +4 -4
- package/dist/cli/{billing-V3T2YPBR.js → billing-4QAWLCKH.js} +73 -73
- package/dist/cli/{billing-5TGADGMX.mjs → billing-GABU2MTX.mjs} +4 -4
- package/dist/cli/{chunk-PZGRH4X7.mjs → chunk-2ELMQ6LW.mjs} +4 -4
- package/dist/cli/{chunk-R4MGS7YD.mjs → chunk-2GNX6SCO.mjs} +24 -0
- package/dist/cli/{chunk-WXJAODJD.js → chunk-2I42ORGH.js} +1 -1
- package/dist/cli/{chunk-D7NOGNG5.js → chunk-3TYXI7MD.js} +6 -6
- package/dist/cli/{chunk-IPJ3DZ7I.js → chunk-72XLUEP6.js} +16 -16
- package/dist/cli/{chunk-632AG45P.js → chunk-76DCNYH3.js} +2 -2
- package/dist/cli/{chunk-7QLXY6RP.mjs → chunk-BQQ4LEQB.mjs} +1 -1
- package/dist/cli/{chunk-JU67SR7M.js → chunk-D4VWHTDT.js} +6 -6
- package/dist/cli/{chunk-K4EHBVYV.js → chunk-DM6Q634K.js} +24 -0
- package/dist/cli/{chunk-JJ7SVPMN.mjs → chunk-E6ESUF5C.mjs} +1 -1
- package/dist/cli/{chunk-Q5LCLAY5.js → chunk-EBW6KRTG.js} +4 -4
- package/dist/cli/{chunk-BFV62ZMO.mjs → chunk-F3ORKGAM.mjs} +2 -2
- package/dist/cli/{chunk-Z6TTBJHH.js → chunk-FB3B2NKV.js} +8 -8
- package/dist/cli/{chunk-U5PCCQMO.js → chunk-FCF5BP3Q.js} +2 -2
- package/dist/cli/{chunk-G56WUJBT.mjs → chunk-FDQAOF3L.mjs} +3 -3
- package/dist/cli/{chunk-KAM3ZGK4.mjs → chunk-HO2TOFKF.mjs} +14 -1
- package/dist/cli/{chunk-PXUAU5Q6.mjs → chunk-HUBVYO52.mjs} +2 -2
- package/dist/cli/{chunk-5IJDDKD6.mjs → chunk-IAL3KSJT.mjs} +1 -1
- package/dist/cli/{chunk-JHT2LCK3.js → chunk-IX7ZGPLU.js} +8 -8
- package/dist/cli/{chunk-BZ3RMXER.js → chunk-KGR7SR3C.js} +113 -81
- package/dist/cli/{chunk-QHDQIHME.mjs → chunk-MGBVCVJ7.mjs} +1 -1
- package/dist/cli/{chunk-XGKH5EC7.js → chunk-MPY4UD6H.js} +93 -80
- package/dist/cli/{chunk-AFWYYSKY.mjs → chunk-N7T6S5SU.mjs} +2 -2
- package/dist/cli/{chunk-6VB2BPUX.js → chunk-P4ITKGRQ.js} +50 -50
- package/dist/cli/{chunk-HS3A4Q6E.mjs → chunk-QFTJ24UV.mjs} +3 -3
- package/dist/cli/{chunk-ZOPU46KZ.js → chunk-R3X55OMZ.js} +20 -20
- package/dist/cli/{chunk-UNX3UQFJ.mjs → chunk-RIJ4VTYJ.mjs} +3 -3
- package/dist/cli/{chunk-OOXULCVG.mjs → chunk-SWZQBMXR.mjs} +2 -2
- package/dist/cli/{chunk-BR63JXVC.js → chunk-TWXPEHTM.js} +52 -52
- package/dist/cli/{chunk-QOTWZX7F.mjs → chunk-UN3F6ZKR.mjs} +5 -5
- package/dist/cli/{chunk-NEGUDVTQ.js → chunk-WJ4PNSX3.js} +26 -26
- package/dist/cli/{chunk-YRK64KJY.js → chunk-XFVHEDRH.js} +35 -35
- package/dist/cli/{chunk-RG4ORMHV.mjs → chunk-XMSVK6O4.mjs} +42 -10
- package/dist/cli/{chunk-JIY4IN6O.mjs → chunk-ZTJUGK5I.mjs} +1 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-BWEZ5PWQ.mjs → csv-NZOZIEQP.mjs} +3 -3
- package/dist/cli/{csv-WL7ZWIT5.js → csv-TVVXG42B.js} +12 -12
- package/dist/cli/{db-DCTSMDWZ.js → db-3Q2OPJW6.js} +25 -25
- package/dist/cli/{db-KAR7YCP4.mjs → db-PEZHN563.mjs} +4 -4
- package/dist/cli/{describe-EMVTMHVJ.mjs → describe-GHSBWUUS.mjs} +12 -12
- package/dist/cli/{describe-A7FCQTHV.js → describe-M7AP5WVH.js} +16 -16
- package/dist/cli/describe-core.d.mts +1 -1
- package/dist/cli/describe-core.d.ts +1 -1
- package/dist/cli/{executions-XR4PN6WX.mjs → executions-7E3GU4QA.mjs} +4 -4
- package/dist/cli/{executions-YSUL2TQR.js → executions-YKR2SAZF.js} +6 -6
- package/dist/cli/{feedback-PJSTAXH7.mjs → feedback-JSPMENHA.mjs} +3 -3
- package/dist/cli/{feedback-G5IU7E4Y.js → feedback-JTRYBUQZ.js} +7 -7
- package/dist/cli/git-6QITFAMM.js +24 -0
- package/dist/cli/{git-TJ5Q2Z7A.mjs → git-R4PATSRX.mjs} +4 -4
- package/dist/cli/index.js +135 -135
- package/dist/cli/index.mjs +37 -37
- package/dist/cli/{legacy-noops-GS3DMVI5.js → legacy-noops-3OMVEANW.js} +7 -7
- package/dist/cli/{legacy-noops-O6OLRAES.mjs → legacy-noops-W52GTS36.mjs} +4 -4
- package/dist/cli/{monitors-BPEMPIO4.mjs → monitors-SIXLFZJ3.mjs} +4 -4
- package/dist/cli/{monitors-A4S5WBGO.js → monitors-YA6X5BM4.js} +84 -84
- package/dist/cli/{org-VQCNY2WB.js → org-73YXPEZ5.js} +66 -66
- package/dist/cli/{org-OL3AIYSH.mjs → org-EYFKI2ZI.mjs} +4 -4
- package/dist/cli/{play-7XS2VNKK.mjs → play-7EF6XSS6.mjs} +10 -10
- package/dist/cli/{play-U6UJM67Q.js → play-CSRSSDTC.js} +283 -283
- package/dist/cli/{providers-RLVGGWTW.js → providers-IHQGSP3E.js} +7 -7
- package/dist/cli/{providers-S7Q4I65H.mjs → providers-MKIVZMBG.mjs} +4 -4
- package/dist/cli/{quickstart-BNSND2KM.js → quickstart-26QTTEHV.js} +5 -5
- package/dist/cli/{quickstart-2XZPRIBJ.mjs → quickstart-COU7YD7S.mjs} +3 -3
- package/dist/cli/search-DOK42NBV.js +30 -0
- package/dist/cli/{search-UVIIPKWR.mjs → search-YKN4OI4P.mjs} +5 -5
- package/dist/cli/{secrets-DQUHORO5.mjs → secrets-CQPQQJ76.mjs} +4 -4
- package/dist/cli/{secrets-RKE6ZNTC.js → secrets-W3DT7F7Q.js} +13 -13
- package/dist/cli/{sessions-4Y7G5432.js → sessions-GYKUO55E.js} +5 -5
- package/dist/cli/{sessions-W77NIN3J.mjs → sessions-U5ULT5CF.mjs} +4 -4
- package/dist/cli/{settings-SL5QVPV3.mjs → settings-6MZCTUWD.mjs} +8 -8
- package/dist/cli/{settings-CTNYYHZP.js → settings-U6ZOQ3FZ.js} +75 -75
- package/dist/cli/{setup-DP6PDQUN.js → setup-HEDWKIGE.js} +42 -42
- package/dist/cli/{setup-Y5UBJKVQ.mjs → setup-JFG3GZGE.mjs} +7 -7
- package/dist/cli/skills-FOGBZYDP.js +29 -0
- package/dist/cli/{skills-LWLEGYDS.mjs → skills-VIY56KK5.mjs} +5 -5
- package/dist/cli/{tools-M2XZNF66.mjs → tools-Y64ZTYTZ.mjs} +12 -12
- package/dist/cli/tools-ZN54N4NT.js +44 -0
- package/dist/cli/{update-EK2YNVKT.mjs → update-2RL67PK2.mjs} +7 -7
- package/dist/cli/update-AZCNZXXP.js +31 -0
- package/dist/cli/{workflow-BHDL5RHZ.js → workflow-FHKZGJGS.js} +15 -15
- package/dist/cli/{workflow-YFZDZT4Z.mjs → workflow-YRI7MT3F.mjs} +5 -5
- package/dist/{client-uX4RCcOS.d.ts → client-9nH8tx4R.d.ts} +9 -0
- package/dist/{client-jgdWPXpp.d.mts → client-Doml68vC.d.mts} +9 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +82 -82
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- 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-DN5GJY5Q.js +0 -40
- package/dist/cli/git-QHEYASI4.js +0 -24
- package/dist/cli/search-J6VQK6XY.js +0 -30
- package/dist/cli/skills-G2Y3KXA3.js +0 -29
- package/dist/cli/tools-6SKR5PQ4.js +0 -44
- package/dist/cli/update-AUB6RNSI.js +0 -31
|
@@ -5220,6 +5220,29 @@ export class DeeplineClient {
|
|
|
5220
5220
|
});
|
|
5221
5221
|
}
|
|
5222
5222
|
|
|
5223
|
+
/** Start provider OAuth and return the URL to open in a browser. */
|
|
5224
|
+
async startIntegrationOAuth(
|
|
5225
|
+
provider: string,
|
|
5226
|
+
options: {
|
|
5227
|
+
preset?: string;
|
|
5228
|
+
scopes?: string[];
|
|
5229
|
+
optionalScopes?: string[];
|
|
5230
|
+
} = {},
|
|
5231
|
+
): Promise<{ ok: boolean; redirect_url: string }> {
|
|
5232
|
+
const scopes = options.scopes?.map((scope) => scope.trim()).filter(Boolean);
|
|
5233
|
+
if (scopes !== undefined && scopes.length === 0) {
|
|
5234
|
+
throw new Error('scopes must contain at least one OAuth scope.');
|
|
5235
|
+
}
|
|
5236
|
+
return this.http.post('/api/v2/integrations/connect', {
|
|
5237
|
+
provider,
|
|
5238
|
+
...(options.preset !== undefined ? { preset: options.preset } : {}),
|
|
5239
|
+
...(scopes !== undefined ? { scopes } : {}),
|
|
5240
|
+
...(options.optionalScopes !== undefined
|
|
5241
|
+
? { optional_scopes: options.optionalScopes }
|
|
5242
|
+
: {}),
|
|
5243
|
+
});
|
|
5244
|
+
}
|
|
5245
|
+
|
|
5223
5246
|
/** Start the Slack OAuth flow required by product notifications. */
|
|
5224
5247
|
async connectNotificationSlack(options?: {
|
|
5225
5248
|
successUrl?: string;
|
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.439',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -345,6 +345,25 @@
|
|
|
345
345
|
"failureAlert": "github_workflow_run",
|
|
346
346
|
"domainReportRequired": true
|
|
347
347
|
},
|
|
348
|
+
{
|
|
349
|
+
"id": "github.tamradar-dev-account-cleanup",
|
|
350
|
+
"name": "TamRadar Dev Account Cleanup",
|
|
351
|
+
"workflowEvents": ["schedule"],
|
|
352
|
+
"scheduler": "github_actions",
|
|
353
|
+
"cadence": "0 3 * * *",
|
|
354
|
+
"timezone": "America/New_York",
|
|
355
|
+
"source": ".github/workflows/tamradar-dev-account-cleanup.yml",
|
|
356
|
+
"locator": "schedule:",
|
|
357
|
+
"owner": "platform",
|
|
358
|
+
"criticality": "maintenance",
|
|
359
|
+
"purpose": "Deactivate every active radar on the TamRadar dev account at 3 AM New York time, so radars left by Preview, local development and load tests cost at most a day. Refuses any key but the pinned dev key, and any account without the pinned marker radar.",
|
|
360
|
+
"successDefinition": "The run proves the pinned dev key and marker radar, deactivates every active radar it lists, and a final listing finds none.",
|
|
361
|
+
"failureDefinition": "The key or account check refuses, TamRadar refuses a radar or keeps answering 429, a final listing still finds active radars, or the pass exceeds its 45-minute timeout.",
|
|
362
|
+
"startGraceMs": 3600000,
|
|
363
|
+
"runTimeoutMs": 2700000,
|
|
364
|
+
"failureAlert": "github_workflow_run",
|
|
365
|
+
"domainReportRequired": true
|
|
366
|
+
},
|
|
348
367
|
{
|
|
349
368
|
"id": "github.neon-ingestion-cleanup",
|
|
350
369
|
"name": "Neon Ingestion Project Cleanup",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkP4ITKGRQjs = require('./chunk-P4ITKGRQ.js');
|
|
17
|
+
require('./chunk-D4VWHTDT.js');
|
|
18
|
+
require('./chunk-EBW6KRTG.js');
|
|
19
|
+
require('./chunk-NPBJI7RE.js');
|
|
20
|
+
require('./chunk-XNYIZMNQ.js');
|
|
21
|
+
require('./chunk-PPDBRJRW.js');
|
|
22
|
+
require('./chunk-2I42ORGH.js');
|
|
23
|
+
require('./chunk-OG64RBAC.js');
|
|
24
|
+
require('./chunk-COGTRVWW.js');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkP4ITKGRQjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkP4ITKGRQjs.authStatusLine; exports.clearPendingClaim = _chunkP4ITKGRQjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkP4ITKGRQjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkP4ITKGRQjs.handleRegister; exports.handleStatus = _chunkP4ITKGRQjs.handleStatus; exports.handleWait = _chunkP4ITKGRQjs.handleWait; exports.httpJson = _chunkP4ITKGRQjs.httpJson; exports.readPendingAuthClaim = _chunkP4ITKGRQjs.readPendingAuthClaim; exports.readStatusBanner = _chunkP4ITKGRQjs.readStatusBanner; exports.registerAuthCommands = _chunkP4ITKGRQjs.registerAuthCommands; exports.reportSetupCompleted = _chunkP4ITKGRQjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkP4ITKGRQjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkP4ITKGRQjs.statusBannerLine;
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
reportSetupCompleted,
|
|
14
14
|
resolvePendingAuthClaimForResume,
|
|
15
15
|
statusBannerLine
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-SWZQBMXR.mjs";
|
|
17
|
+
import "./chunk-BQQ4LEQB.mjs";
|
|
18
|
+
import "./chunk-ZTJUGK5I.mjs";
|
|
19
19
|
import "./chunk-MAMVGOSC.mjs";
|
|
20
20
|
import "./chunk-DLIRSHV6.mjs";
|
|
21
21
|
import "./chunk-E4IXDAZI.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-MGBVCVJ7.mjs";
|
|
23
23
|
import "./chunk-WZYKRD7T.mjs";
|
|
24
24
|
import "./chunk-KRD6H754.mjs";
|
|
25
25
|
export {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkMPY4UD6Hjs = require('./chunk-MPY4UD6H.js');
|
|
6
6
|
require('./chunk-E4CABWXL.js');
|
|
7
7
|
require('./chunk-2H4EY7KH.js');
|
|
8
8
|
require('./chunk-KXMNM4AQ.js');
|
|
@@ -13,8 +13,8 @@ require('./chunk-XDVT3GOM.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('./chunk-
|
|
16
|
+
var _chunkD4VWHTDTjs = require('./chunk-D4VWHTDT.js');
|
|
17
|
+
require('./chunk-EBW6KRTG.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ require('./chunk-XNYIZMNQ.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _chunkPPDBRJRWjs = require('./chunk-PPDBRJRW.js');
|
|
26
|
-
require('./chunk-
|
|
26
|
+
require('./chunk-2I42ORGH.js');
|
|
27
27
|
require('./chunk-OG64RBAC.js');
|
|
28
28
|
require('./chunk-COGTRVWW.js');
|
|
29
29
|
|
|
@@ -72,7 +72,7 @@ function reportBillingFailure(failure, options) {
|
|
|
72
72
|
if (failure.next) {
|
|
73
73
|
textLines.push(`Next: ${failure.next}`);
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
76
76
|
{
|
|
77
77
|
ok: false,
|
|
78
78
|
exitCode: failure.exitCode,
|
|
@@ -93,7 +93,7 @@ function parseTopUpCredits(raw) {
|
|
|
93
93
|
return parsed;
|
|
94
94
|
}
|
|
95
95
|
function topUpIdempotencyKey(raw) {
|
|
96
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
96
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkMPY4UD6Hjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
97
97
|
}
|
|
98
98
|
function targetBillingIdempotencyKey(raw) {
|
|
99
99
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -299,7 +299,7 @@ function defaultLedgerExportPath() {
|
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
301
|
async function handleBalance(options) {
|
|
302
|
-
const { http } =
|
|
302
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
303
303
|
const payload = await http.get(
|
|
304
304
|
"/api/v2/billing/balance"
|
|
305
305
|
);
|
|
@@ -383,7 +383,7 @@ async function handleBalance(options) {
|
|
|
383
383
|
...options.verbose ? detail : [],
|
|
384
384
|
...lines.slice(1)
|
|
385
385
|
];
|
|
386
|
-
|
|
386
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
387
387
|
{
|
|
388
388
|
...payload,
|
|
389
389
|
...recovery ? { recovery } : {},
|
|
@@ -407,7 +407,7 @@ function quoteShellArgument(value) {
|
|
|
407
407
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
408
408
|
}
|
|
409
409
|
async function handleUsage(options) {
|
|
410
|
-
const { http } =
|
|
410
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
411
411
|
const params = new URLSearchParams();
|
|
412
412
|
if (options.requestId !== void 0) {
|
|
413
413
|
const requestId = options.requestId.trim();
|
|
@@ -488,7 +488,7 @@ async function handleUsage(options) {
|
|
|
488
488
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
489
489
|
] : []
|
|
490
490
|
];
|
|
491
|
-
|
|
491
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
492
492
|
{
|
|
493
493
|
...payload,
|
|
494
494
|
recent: {
|
|
@@ -502,7 +502,7 @@ async function handleUsage(options) {
|
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
504
|
async function handleLimit(options) {
|
|
505
|
-
const { http } =
|
|
505
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
506
506
|
const payload = await http.get(
|
|
507
507
|
"/api/v2/billing/limit"
|
|
508
508
|
);
|
|
@@ -510,7 +510,7 @@ async function handleLimit(options) {
|
|
|
510
510
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
511
511
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
512
512
|
] : ["Monthly usage cap: off"];
|
|
513
|
-
|
|
513
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
514
514
|
{
|
|
515
515
|
...payload,
|
|
516
516
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -519,12 +519,12 @@ async function handleLimit(options) {
|
|
|
519
519
|
);
|
|
520
520
|
}
|
|
521
521
|
async function handleSetLimit(credits, options) {
|
|
522
|
-
const { http } =
|
|
522
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
523
523
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
524
524
|
method: "PUT",
|
|
525
525
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
526
526
|
});
|
|
527
|
-
|
|
527
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
528
528
|
{
|
|
529
529
|
...payload,
|
|
530
530
|
render: {
|
|
@@ -540,11 +540,11 @@ async function handleSetLimit(credits, options) {
|
|
|
540
540
|
);
|
|
541
541
|
}
|
|
542
542
|
async function handleLimitOff(options) {
|
|
543
|
-
const { http } =
|
|
543
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
544
544
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
545
545
|
method: "DELETE"
|
|
546
546
|
});
|
|
547
|
-
|
|
547
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
548
548
|
{
|
|
549
549
|
...payload,
|
|
550
550
|
render: {
|
|
@@ -564,7 +564,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
564
564
|
let initialized = false;
|
|
565
565
|
let pageNumber = 0;
|
|
566
566
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
567
|
-
for await (const entries of
|
|
567
|
+
for await (const entries of _chunkMPY4UD6Hjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
568
568
|
pageNumber += 1;
|
|
569
569
|
console.error(
|
|
570
570
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -603,7 +603,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
603
603
|
return summary;
|
|
604
604
|
}
|
|
605
605
|
async function handleHistory(options) {
|
|
606
|
-
const { http } =
|
|
606
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
607
607
|
const windows = {
|
|
608
608
|
"1d": 86400,
|
|
609
609
|
"1w": 604800,
|
|
@@ -615,10 +615,10 @@ async function handleHistory(options) {
|
|
|
615
615
|
process.cwd(),
|
|
616
616
|
"deepline",
|
|
617
617
|
"data",
|
|
618
|
-
|
|
618
|
+
_chunkD4VWHTDTjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
619
619
|
);
|
|
620
620
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
621
|
-
|
|
621
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
622
622
|
{
|
|
623
623
|
output_path: outputPath,
|
|
624
624
|
row_count: summary.row_count,
|
|
@@ -655,14 +655,14 @@ async function handleLedgerExportAll(options) {
|
|
|
655
655
|
);
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
|
-
const { http } =
|
|
658
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
659
659
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
660
660
|
const summary = await exportLedger(http, outputPath, {
|
|
661
661
|
sinceAt,
|
|
662
662
|
runId: options.runId,
|
|
663
663
|
operation: options.operation
|
|
664
664
|
});
|
|
665
|
-
|
|
665
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
666
666
|
{
|
|
667
667
|
output_path: outputPath,
|
|
668
668
|
row_count: summary.row_count,
|
|
@@ -701,7 +701,7 @@ function targetPlanLine(plan) {
|
|
|
701
701
|
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"}`;
|
|
702
702
|
}
|
|
703
703
|
async function handlePlans(options) {
|
|
704
|
-
const client = new (0,
|
|
704
|
+
const client = new (0, _chunkMPY4UD6Hjs.DeeplineClient)();
|
|
705
705
|
const payload = await client.billing.targetPlans();
|
|
706
706
|
const listedCurrentPlan = payload.plans.find(
|
|
707
707
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -714,8 +714,8 @@ async function handlePlans(options) {
|
|
|
714
714
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
715
715
|
"Change plan: deepline billing change-plan <plan_sku>"
|
|
716
716
|
];
|
|
717
|
-
const legacyPayload =
|
|
718
|
-
|
|
717
|
+
const legacyPayload = _chunkD4VWHTDTjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
718
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
719
719
|
{
|
|
720
720
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
721
721
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -725,7 +725,7 @@ async function handlePlans(options) {
|
|
|
725
725
|
);
|
|
726
726
|
}
|
|
727
727
|
async function handleSubscribe(planVersionId, options) {
|
|
728
|
-
const { http } =
|
|
728
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
729
729
|
const payload = await http.request(
|
|
730
730
|
"/api/v2/billing/subscription/checkout",
|
|
731
731
|
{
|
|
@@ -734,8 +734,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
734
734
|
}
|
|
735
735
|
);
|
|
736
736
|
const url = String(payload.checkout_url || "");
|
|
737
|
-
if (!options.json && options.open !== false && url)
|
|
738
|
-
|
|
737
|
+
if (!options.json && options.open !== false && url) _chunkD4VWHTDTjs.openInBrowser.call(void 0, url);
|
|
738
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
739
739
|
{
|
|
740
740
|
...payload,
|
|
741
741
|
render: {
|
|
@@ -751,7 +751,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
751
751
|
);
|
|
752
752
|
}
|
|
753
753
|
async function handleSubscriptionStatus(options) {
|
|
754
|
-
const client = new (0,
|
|
754
|
+
const client = new (0, _chunkMPY4UD6Hjs.DeeplineClient)();
|
|
755
755
|
const payload = await client.billing.subscription.status();
|
|
756
756
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
757
757
|
const lines = [
|
|
@@ -771,7 +771,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
771
771
|
],
|
|
772
772
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
773
773
|
];
|
|
774
|
-
|
|
774
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
775
775
|
{
|
|
776
776
|
...payload,
|
|
777
777
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -780,7 +780,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
780
780
|
);
|
|
781
781
|
}
|
|
782
782
|
async function handleSubscriptionCancel(options) {
|
|
783
|
-
const client = new (0,
|
|
783
|
+
const client = new (0, _chunkMPY4UD6Hjs.DeeplineClient)();
|
|
784
784
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
785
785
|
if (options.dryRun) {
|
|
786
786
|
const status = await client.billing.subscription.status();
|
|
@@ -797,7 +797,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
797
797
|
return;
|
|
798
798
|
}
|
|
799
799
|
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.";
|
|
800
|
-
|
|
800
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
801
801
|
{
|
|
802
802
|
ok: true,
|
|
803
803
|
dry_run: true,
|
|
@@ -852,7 +852,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
852
852
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
853
853
|
"Undo with: deepline billing subscription cancel --undo"
|
|
854
854
|
];
|
|
855
|
-
|
|
855
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
856
856
|
{
|
|
857
857
|
ok: true,
|
|
858
858
|
...result,
|
|
@@ -906,7 +906,7 @@ async function handleInvoices(options) {
|
|
|
906
906
|
return;
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
|
-
const client = new (0,
|
|
909
|
+
const client = new (0, _chunkMPY4UD6Hjs.DeeplineClient)();
|
|
910
910
|
let payload;
|
|
911
911
|
try {
|
|
912
912
|
payload = await client.billing.invoices.list(
|
|
@@ -935,7 +935,7 @@ async function handleInvoices(options) {
|
|
|
935
935
|
url: entry.url
|
|
936
936
|
}))
|
|
937
937
|
} : { ...payload, count: entries.length };
|
|
938
|
-
|
|
938
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
939
939
|
{
|
|
940
940
|
...envelope,
|
|
941
941
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -944,7 +944,7 @@ async function handleInvoices(options) {
|
|
|
944
944
|
);
|
|
945
945
|
}
|
|
946
946
|
async function handleCheckout(options) {
|
|
947
|
-
const { http } =
|
|
947
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
948
948
|
const payload = await http.post(
|
|
949
949
|
"/api/v2/billing/checkout",
|
|
950
950
|
{
|
|
@@ -954,8 +954,8 @@ async function handleCheckout(options) {
|
|
|
954
954
|
}
|
|
955
955
|
);
|
|
956
956
|
const url = String(payload.url || payload.checkout_url || "");
|
|
957
|
-
if (!options.json && !options.noOpen && url)
|
|
958
|
-
|
|
957
|
+
if (!options.json && !options.noOpen && url) _chunkD4VWHTDTjs.openInBrowser.call(void 0, url);
|
|
958
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
959
959
|
{
|
|
960
960
|
...payload,
|
|
961
961
|
render: {
|
|
@@ -1000,7 +1000,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1000
1000
|
return;
|
|
1001
1001
|
}
|
|
1002
1002
|
if (options.dryRun) {
|
|
1003
|
-
|
|
1003
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1004
1004
|
{
|
|
1005
1005
|
ok: true,
|
|
1006
1006
|
dry_run: true,
|
|
@@ -1030,7 +1030,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1030
1030
|
);
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|
|
1033
|
-
const client = new (0,
|
|
1033
|
+
const client = new (0, _chunkMPY4UD6Hjs.DeeplineClient)();
|
|
1034
1034
|
let payload;
|
|
1035
1035
|
try {
|
|
1036
1036
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1047,7 +1047,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1047
1047
|
return;
|
|
1048
1048
|
}
|
|
1049
1049
|
if (payload.status === "pending") {
|
|
1050
|
-
|
|
1050
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1051
1051
|
{
|
|
1052
1052
|
ok: true,
|
|
1053
1053
|
...payload,
|
|
@@ -1111,17 +1111,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1111
1111
|
]
|
|
1112
1112
|
}
|
|
1113
1113
|
};
|
|
1114
|
-
|
|
1114
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1115
1115
|
json: options.json
|
|
1116
1116
|
});
|
|
1117
1117
|
}
|
|
1118
1118
|
async function handleTargetStatus(options) {
|
|
1119
|
-
const client = new (0,
|
|
1119
|
+
const client = new (0, _chunkMPY4UD6Hjs.DeeplineClient)();
|
|
1120
1120
|
const payload = await client.billing.targetStatus();
|
|
1121
1121
|
const balanceCommand = "deepline billing balance";
|
|
1122
1122
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1123
1123
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1124
|
-
|
|
1124
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1125
1125
|
{
|
|
1126
1126
|
ok: true,
|
|
1127
1127
|
...payload,
|
|
@@ -1151,8 +1151,8 @@ async function handleTargetStatus(options) {
|
|
|
1151
1151
|
);
|
|
1152
1152
|
}
|
|
1153
1153
|
async function handleEntitlements(options) {
|
|
1154
|
-
const payload = await new (0,
|
|
1155
|
-
|
|
1154
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.entitlements();
|
|
1155
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1156
1156
|
{
|
|
1157
1157
|
ok: true,
|
|
1158
1158
|
...payload,
|
|
@@ -1180,7 +1180,7 @@ async function handleEntitlements(options) {
|
|
|
1180
1180
|
);
|
|
1181
1181
|
}
|
|
1182
1182
|
async function handleAutoRechargeStatus(options) {
|
|
1183
|
-
const payload = await new (0,
|
|
1183
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1184
1184
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1185
1185
|
const lines = [
|
|
1186
1186
|
`State: ${state}`,
|
|
@@ -1190,7 +1190,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1190
1190
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1191
1191
|
] : []
|
|
1192
1192
|
];
|
|
1193
|
-
|
|
1193
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1194
1194
|
{
|
|
1195
1195
|
ok: true,
|
|
1196
1196
|
...payload,
|
|
@@ -1239,7 +1239,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1241
1241
|
if (options.dryRun) {
|
|
1242
|
-
|
|
1242
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1243
1243
|
{
|
|
1244
1244
|
ok: true,
|
|
1245
1245
|
dry_run: true,
|
|
@@ -1260,7 +1260,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1260
1260
|
);
|
|
1261
1261
|
return;
|
|
1262
1262
|
}
|
|
1263
|
-
const payload = await new (0,
|
|
1263
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1264
1264
|
enabled: true,
|
|
1265
1265
|
thresholdCredits,
|
|
1266
1266
|
refillToCredits,
|
|
@@ -1268,7 +1268,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1268
1268
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1269
1269
|
idempotencyKey
|
|
1270
1270
|
});
|
|
1271
|
-
|
|
1271
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1272
1272
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1273
1273
|
{ json: options.json }
|
|
1274
1274
|
);
|
|
@@ -1276,7 +1276,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1276
1276
|
async function handleAutoRechargeOff(options) {
|
|
1277
1277
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1278
1278
|
if (options.dryRun) {
|
|
1279
|
-
|
|
1279
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1280
1280
|
{
|
|
1281
1281
|
ok: true,
|
|
1282
1282
|
dry_run: true,
|
|
@@ -1291,11 +1291,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1291
1291
|
);
|
|
1292
1292
|
return;
|
|
1293
1293
|
}
|
|
1294
|
-
const payload = await new (0,
|
|
1294
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1295
1295
|
enabled: false,
|
|
1296
1296
|
idempotencyKey
|
|
1297
1297
|
});
|
|
1298
|
-
|
|
1298
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1299
1299
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1300
1300
|
{ json: options.json }
|
|
1301
1301
|
);
|
|
@@ -1314,11 +1314,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1314
1314
|
return;
|
|
1315
1315
|
}
|
|
1316
1316
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1317
|
-
const payload = await new (0,
|
|
1317
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.purchaseCredits({
|
|
1318
1318
|
credits,
|
|
1319
1319
|
idempotencyKey
|
|
1320
1320
|
});
|
|
1321
|
-
|
|
1321
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1322
1322
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1323
1323
|
{ json: options.json }
|
|
1324
1324
|
);
|
|
@@ -1354,7 +1354,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1354
1354
|
return;
|
|
1355
1355
|
}
|
|
1356
1356
|
if (options.dryRun) {
|
|
1357
|
-
|
|
1357
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1358
1358
|
{
|
|
1359
1359
|
ok: true,
|
|
1360
1360
|
dry_run: true,
|
|
@@ -1367,12 +1367,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1367
1367
|
);
|
|
1368
1368
|
return;
|
|
1369
1369
|
}
|
|
1370
|
-
const payload = await new (0,
|
|
1370
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1371
1371
|
credits,
|
|
1372
1372
|
orgId: options.orgId,
|
|
1373
1373
|
idempotencyKey: options.idempotencyKey
|
|
1374
1374
|
});
|
|
1375
|
-
|
|
1375
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1376
1376
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1377
1377
|
{ json: options.json }
|
|
1378
1378
|
);
|
|
@@ -1392,37 +1392,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1392
1392
|
return;
|
|
1393
1393
|
}
|
|
1394
1394
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1395
|
-
const payload = await new (0,
|
|
1395
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.transitionPlan({
|
|
1396
1396
|
action: "start_or_change",
|
|
1397
1397
|
targetPlanSku: planSku,
|
|
1398
1398
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1399
1399
|
idempotencyKey
|
|
1400
1400
|
});
|
|
1401
|
-
|
|
1401
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1402
1402
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1403
1403
|
{ json: options.json }
|
|
1404
1404
|
);
|
|
1405
1405
|
}
|
|
1406
1406
|
async function handleTargetPlanCancellation(options) {
|
|
1407
1407
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1408
|
-
const payload = await new (0,
|
|
1408
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.transitionPlan({
|
|
1409
1409
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1410
1410
|
idempotencyKey
|
|
1411
1411
|
});
|
|
1412
|
-
|
|
1412
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1413
1413
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1414
1414
|
{ json: options.json }
|
|
1415
1415
|
);
|
|
1416
1416
|
}
|
|
1417
1417
|
async function handleTargetPortal(options) {
|
|
1418
|
-
const payload = await new (0,
|
|
1418
|
+
const payload = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.portalSession(
|
|
1419
1419
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1420
1420
|
);
|
|
1421
|
-
if (!options.json && !options.noOpen)
|
|
1422
|
-
|
|
1421
|
+
if (!options.json && !options.noOpen) _chunkD4VWHTDTjs.openInBrowser.call(void 0, payload.url);
|
|
1422
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1423
1423
|
}
|
|
1424
1424
|
async function handleRedeemCode(code, options) {
|
|
1425
|
-
const { http } =
|
|
1425
|
+
const { http } = _chunkD4VWHTDTjs.getAuthedHttpClient.call(void 0, );
|
|
1426
1426
|
const payload = await http.post(
|
|
1427
1427
|
"/api/v2/billing/checkout",
|
|
1428
1428
|
{
|
|
@@ -1430,8 +1430,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
);
|
|
1432
1432
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1433
|
-
if (!options.json && !options.noOpen && url)
|
|
1434
|
-
|
|
1433
|
+
if (!options.json && !options.noOpen && url) _chunkD4VWHTDTjs.openInBrowser.call(void 0, url);
|
|
1434
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0,
|
|
1435
1435
|
{
|
|
1436
1436
|
...payload,
|
|
1437
1437
|
render: {
|
|
@@ -1489,14 +1489,14 @@ Examples:
|
|
|
1489
1489
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1490
1490
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1491
1491
|
}
|
|
1492
|
-
const quote = await new (0,
|
|
1492
|
+
const quote = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.quote({
|
|
1493
1493
|
quantity,
|
|
1494
1494
|
sandbox_runtime: {
|
|
1495
1495
|
timeout: options.sandboxTimeout,
|
|
1496
1496
|
size: "standard"
|
|
1497
1497
|
}
|
|
1498
1498
|
});
|
|
1499
|
-
|
|
1499
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0, quote, {
|
|
1500
1500
|
json: options.json,
|
|
1501
1501
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1502
1502
|
${quote.explanation}
|
|
@@ -1726,8 +1726,8 @@ Examples:
|
|
|
1726
1726
|
new (0, _commander.Command)("trigger").description(
|
|
1727
1727
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1728
1728
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1729
|
-
const result = await new (0,
|
|
1730
|
-
|
|
1729
|
+
const result = await new (0, _chunkMPY4UD6Hjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1730
|
+
_chunkD4VWHTDTjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1731
1731
|
})
|
|
1732
1732
|
);
|
|
1733
1733
|
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(
|