deepline 0.3.505 → 0.3.507
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-core.ts +148 -11
- package/dist/bundling-sources/sdk/src/index.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +38 -1
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +176 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/overview.ts +118 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +29 -1
- package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +4 -2
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +29 -10
- package/dist/bundling-sources/shared_libs/monitors/package.json +6 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +15 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +24 -4
- package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +405 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +8 -8
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +52 -5
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +48 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +13 -40
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-egress.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +66 -0
- package/dist/cli/auth-6PJ4G5PC.js +43 -0
- package/dist/cli/{auth-AHE2EDQA.mjs → auth-BNP3M27C.mjs} +5 -5
- package/dist/cli/{billing-JOIZPHON.js → billing-7HIVX4YJ.js} +101 -91
- package/dist/cli/{billing-7CPWTGGI.mjs → billing-JKJ2AEZ6.mjs} +27 -17
- package/dist/cli/{chunk-PDLOPF5L.mjs → chunk-2OKEMB5A.mjs} +1 -1
- package/dist/cli/{chunk-HASFFOSU.js → chunk-2ZINJVWW.js} +16 -16
- package/dist/cli/{chunk-MHZAG2ZQ.js → chunk-3D5ZNYYI.js} +93 -60
- package/dist/cli/{chunk-7DDACLMX.js → chunk-56SRWY5F.js} +16 -16
- package/dist/cli/{chunk-QGNNAZ5M.mjs → chunk-5A66OJZD.mjs} +1 -1
- package/dist/cli/{chunk-UZ24SF7N.mjs → chunk-5I2XKXLS.mjs} +5 -5
- package/dist/cli/{chunk-SPN7U3MV.js → chunk-5PXGAA2M.js} +4 -4
- package/dist/cli/{chunk-EMUFF6EU.js → chunk-6AQO5OJ5.js} +7 -7
- package/dist/cli/{chunk-WTQLUULB.js → chunk-76R5I7HR.js} +6 -6
- package/dist/cli/{chunk-OMEDQ77C.mjs → chunk-7TZA6LJI.mjs} +5 -5
- package/dist/cli/{chunk-JVKEZT7L.mjs → chunk-AFSYNOG4.mjs} +22 -1
- package/dist/cli/{chunk-OORPAQVC.js → chunk-AXYLMDU3.js} +8 -8
- package/dist/cli/{chunk-FIQ5UEIF.mjs → chunk-D2T4W5LR.mjs} +2 -2
- package/dist/cli/{chunk-Y52XY56V.js → chunk-E5HGDYU3.js} +41 -41
- package/dist/cli/{chunk-3YEOOXD4.js → chunk-E7YIIEZU.js} +11 -11
- package/dist/cli/{chunk-NARJWXBR.mjs → chunk-EEJLV77L.mjs} +2 -2
- package/dist/cli/{chunk-7DDKLFOY.mjs → chunk-EYZJDHXA.mjs} +3 -3
- package/dist/cli/{chunk-K26YOPDO.js → chunk-GDHLL5EQ.js} +22 -1
- package/dist/cli/{chunk-WTUC5VKB.mjs → chunk-GMRWVXU2.mjs} +2 -2
- package/dist/cli/{chunk-PZN24YQQ.mjs → chunk-H334EFON.mjs} +2 -2
- package/dist/cli/{chunk-RT3HJBIH.mjs → chunk-H6PABDS4.mjs} +10 -10
- package/dist/cli/{chunk-7QLK2GHL.js → chunk-HPZONIDF.js} +5 -5
- package/dist/cli/{chunk-5XT4DZQL.mjs → chunk-IBKWVFWP.mjs} +2 -2
- package/dist/cli/{chunk-45XYW477.js → chunk-ILUZ7IHP.js} +21 -21
- package/dist/cli/{chunk-SHKRL7CW.mjs → chunk-IWZRQ6YW.mjs} +1 -1
- package/dist/cli/{chunk-ACI6CUDX.mjs → chunk-JCE2JNGD.mjs} +78 -45
- package/dist/cli/{chunk-XHPB6RGY.js → chunk-JPN6OBPW.js} +1 -1
- package/dist/cli/{chunk-W6I4N4JN.mjs → chunk-LSONU2E2.mjs} +6 -6
- package/dist/cli/{chunk-VXKWF3AD.js → chunk-MN5HO2PN.js} +9 -9
- package/dist/cli/{chunk-6FEN6VWZ.js → chunk-MQRT5NYP.js} +26 -26
- package/dist/cli/{chunk-52FPW2RD.mjs → chunk-NJRJGXVF.mjs} +2 -2
- package/dist/cli/{chunk-BWAYMJ23.js → chunk-OBATCFZO.js} +91 -48
- package/dist/cli/{chunk-YBIVVAL7.mjs → chunk-OPEJASMJ.mjs} +3 -3
- package/dist/cli/{chunk-GXMNOUHP.js → chunk-QWRSWQ7Z.js} +7 -7
- package/dist/cli/{chunk-GAUNJCXQ.js → chunk-REFT4DMJ.js} +96 -96
- package/dist/cli/{chunk-QYGYVCRI.js → chunk-RFJANXCC.js} +14 -14
- package/dist/cli/{chunk-4OFSAZN6.mjs → chunk-RTLWYERT.mjs} +46 -3
- package/dist/cli/{chunk-CSLLQWAB.mjs → chunk-T6FUNWXX.mjs} +1 -1
- package/dist/cli/{chunk-JA7YBRP4.mjs → chunk-TVR4R2E6.mjs} +1 -1
- package/dist/cli/{chunk-ZLN2B5YA.js → chunk-TZ7APOBM.js} +3 -3
- package/dist/cli/{chunk-JSTKLYYD.js → chunk-V2K34NAO.js} +2 -2
- package/dist/cli/{chunk-WPCF7C6B.js → chunk-V4GGTOCX.js} +3 -3
- package/dist/cli/{chunk-IZYOYXG7.mjs → chunk-VGEBRTHF.mjs} +4 -4
- package/dist/cli/{chunk-OA6U5NVB.mjs → chunk-VQLD5M43.mjs} +5 -5
- package/dist/cli/{chunk-LC4FG34E.js → chunk-WOPWSAGS.js} +53 -53
- package/dist/cli/{chunk-MAFZ64RN.mjs → chunk-WQAHMVBT.mjs} +2 -2
- package/dist/cli/{chunk-IDAE5VDH.js → chunk-WTY2R4R3.js} +5 -5
- package/dist/cli/{chunk-6U3AGJWI.mjs → chunk-XKGNEN4P.mjs} +1 -1
- package/dist/cli/{chunk-7AD565DO.mjs → chunk-YAAJHS6W.mjs} +1 -1
- package/dist/cli/{chunk-CA3SYXCS.js → chunk-ZCNGMQVD.js} +2 -2
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-WTPI6ZON.mjs → csv-LZTQOPP2.mjs} +4 -4
- package/dist/cli/{csv-DZHVIW3G.js → csv-WYJVU5HV.js} +13 -13
- package/dist/cli/{db-NR4PJ6AF.mjs → db-D6XFOQP3.mjs} +6 -6
- package/dist/cli/{db-D7LPPNCC.js → db-UCUXPY7S.js} +27 -27
- package/dist/cli/{describe-NCKAJPUG.mjs → describe-HKL2XK67.mjs} +18 -18
- package/dist/cli/describe-XS4OIASD.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-UQG6LWEN.js → executions-5CF5NM7V.js} +8 -8
- package/dist/cli/{executions-RQVJ4LAB.mjs → executions-AFHYXH73.mjs} +6 -6
- package/dist/cli/{feedback-TCHA67IA.js → feedback-GJAX3JZE.js} +8 -8
- package/dist/cli/{feedback-RD4Y3YQR.mjs → feedback-MLKQ572F.mjs} +4 -4
- package/dist/cli/{git-Z7434B7Y.mjs → git-BMLROZOU.mjs} +5 -5
- package/dist/cli/git-RIXUHRDL.js +25 -0
- package/dist/cli/index.js +145 -149
- package/dist/cli/index.mjs +46 -50
- package/dist/cli/{legacy-noops-23WRA7DH.js → legacy-noops-FHRDF7MC.js} +8 -8
- package/dist/cli/{legacy-noops-LQJU4UIV.mjs → legacy-noops-Y7JSQVLQ.mjs} +5 -5
- package/dist/cli/{monitors-KOWN7M3V.js → monitors-Z6RPIQIH.js} +450 -138
- package/dist/cli/{monitors-Z6VYUZ2W.mjs → monitors-ZEVK3UD7.mjs} +332 -20
- package/dist/cli/{org-UBNRO5XO.mjs → org-PFLVANIN.mjs} +6 -6
- package/dist/cli/{org-2T5K2VP5.js → org-TXJ3RES5.js} +72 -72
- package/dist/cli/{pages-GHPJBVV3.mjs → pages-BKEMQ2J7.mjs} +6 -6
- package/dist/cli/{pages-SRXTU7XO.js → pages-ESKKBK5Y.js} +18 -18
- package/dist/cli/{play-HRQKGTXA.mjs → play-4Z6Z7KVY.mjs} +18 -18
- package/dist/cli/{play-2HMZ57EZ.js → play-AAFOZJKQ.js} +317 -317
- package/dist/cli/{providers-JWJRFRR5.mjs → providers-KYP2UWDV.mjs} +6 -6
- package/dist/cli/{providers-P5O676MZ.js → providers-WEU4UNKY.js} +9 -9
- package/dist/cli/{quickstart-S7NZUQRO.mjs → quickstart-7EUDF4IL.mjs} +4 -4
- package/dist/cli/{quickstart-YCY72TAO.js → quickstart-DXYZCOJY.js} +6 -6
- package/dist/cli/{run-MHLLGF4G.js → run-3YN6P26W.js} +41 -41
- package/dist/cli/{run-QWMRIUIU.mjs → run-MB2R5PQ7.mjs} +23 -23
- package/dist/cli/{search-4BFTQUEP.mjs → search-MIFBESRE.mjs} +8 -8
- package/dist/cli/search-Z7GUKVFE.js +33 -0
- package/dist/cli/{search-output-LIYHDTBP.mjs → search-output-2IR3UA4W.mjs} +4 -4
- package/dist/cli/{search-output-62LBVZHN.js → search-output-NUWL47SR.js} +6 -6
- package/dist/cli/{secrets-KKKHVSOO.js → secrets-6UT6BIDJ.js} +15 -15
- package/dist/cli/{secrets-GW27V77E.mjs → secrets-E6WIYONW.mjs} +6 -6
- package/dist/cli/{sessions-R75LBGIL.mjs → sessions-AP7L6YCL.mjs} +5 -5
- package/dist/cli/{sessions-R3OEINAR.js → sessions-NF2RBXMJ.js} +6 -6
- package/dist/cli/{settings-MQIHAEZN.js → settings-FZWXYP4W.js} +106 -79
- package/dist/cli/{settings-I3AQZSYG.mjs → settings-MMLHJ5E5.mjs} +39 -12
- package/dist/cli/{setup-2YA5MYMS.mjs → setup-WJNN2CZZ.mjs} +10 -10
- package/dist/cli/{setup-X3QRJERP.js → setup-YHXAAJNZ.js} +50 -50
- package/dist/cli/skills-4YYUFNMS.js +37 -0
- package/dist/cli/{skills-7252FOOI.mjs → skills-KXZ5PJU2.mjs} +8 -8
- package/dist/cli/{tools-SKQTSVGE.mjs → tools-K6S7RX7B.mjs} +17 -17
- package/dist/cli/tools-OCYEMMUP.js +57 -0
- package/dist/cli/{update-GNBBSKTB.mjs → update-2SFWEVM6.mjs} +10 -10
- package/dist/cli/update-WQIPUQ4K.js +35 -0
- package/dist/cli/{workflow-OJSAL5FO.mjs → workflow-IR3RCVHZ.mjs} +7 -7
- package/dist/cli/{workflow-QB7YYWPP.js → workflow-SM3Q45X5.js} +17 -17
- package/dist/{client-B3GSaSFn.d.ts → client-BlwD-G4v.d.ts} +1 -1
- package/dist/{client-DEJg0CZn.d.mts → client-DMpsMNH9.d.mts} +1 -1
- package/dist/{client-core-C404E33V.d.mts → client-core-CITtRTbB.d.mts} +77 -11
- package/dist/{client-core-GQmy3N8y.d.ts → client-core-DwBLuEkm.d.ts} +77 -11
- package/dist/{compiler-manifest-DaJrA2KV.d.mts → compiler-manifest-BeURaD5Y.d.mts} +2 -0
- package/dist/{compiler-manifest-DaJrA2KV.d.ts → compiler-manifest-BeURaD5Y.d.ts} +2 -0
- package/dist/{errors-KLga4bLr.d.ts → errors-BoPXPrSy.d.ts} +1 -1
- package/dist/{errors-BKnSYueU.d.mts → errors-kBuT4kGK.d.mts} +1 -1
- package/dist/{index-C5nAZ-VS.d.ts → index-D0crdGM1.d.ts} +1 -1
- package/dist/{index-C-8AFpWy.d.mts → index-DC7oRAAC.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -112
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- 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/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-SEPKNRHV.js +0 -43
- package/dist/cli/describe-HVQBTKFM.js +0 -50
- package/dist/cli/git-TUB2ZUEH.js +0 -25
- package/dist/cli/search-QPUHOEIL.js +0 -33
- package/dist/cli/skills-BPZWMZSL.js +0 -37
- package/dist/cli/tools-F7RVQ3IK.js +0 -57
- package/dist/cli/update-TLSY6LC2.js +0 -35
|
@@ -1218,17 +1218,36 @@ export type MonitorsAvailableOptions = {
|
|
|
1218
1218
|
*
|
|
1219
1219
|
* `provisioning` is a monitor whose create was recorded but that the provider
|
|
1220
1220
|
* has not confirmed yet; it delivers no events and does not bill until it
|
|
1221
|
-
* becomes `active`. A Fleet is never `provisioning`.
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1221
|
+
* becomes `active`. A Fleet is never `provisioning`.
|
|
1222
|
+
*
|
|
1223
|
+
* `errored` is a monitor the provider stopped after it was created, in a way
|
|
1224
|
+
* that resubmitting the same definition cannot fix (for example its LinkedIn
|
|
1225
|
+
* URL no longer resolves). `failure` says why and what to do: update the
|
|
1226
|
+
* monitor's payload, which creates a fresh resource, or delete it. A Fleet is
|
|
1227
|
+
* never `errored`; its member monitors are.
|
|
1228
|
+
*
|
|
1229
|
+
* Provider cleanup and retries are Monitor Job progress and must never be
|
|
1230
|
+
* added to this union. The `status` and `active` fields below are retained
|
|
1231
|
+
* only as deprecated compatibility aliases for older API responses.
|
|
1225
1232
|
*/
|
|
1226
1233
|
export type MonitorState =
|
|
1227
1234
|
| 'active'
|
|
1228
1235
|
| 'provisioning'
|
|
1229
1236
|
| 'billing_suspended'
|
|
1237
|
+
| 'errored'
|
|
1230
1238
|
| 'disabled';
|
|
1231
1239
|
|
|
1240
|
+
/** Why an `errored` monitor stopped, and what fixes it. */
|
|
1241
|
+
export type MonitorFailure = {
|
|
1242
|
+
/** The provider's reason code, e.g. `source_inaccessible`. */
|
|
1243
|
+
reason: string;
|
|
1244
|
+
/** What the customer does about it. */
|
|
1245
|
+
message: string;
|
|
1246
|
+
failed_at: string;
|
|
1247
|
+
/** Failures of resources created from the current payload. */
|
|
1248
|
+
failure_count: number;
|
|
1249
|
+
};
|
|
1250
|
+
|
|
1232
1251
|
/** List filters accepted by the canonical state surface. */
|
|
1233
1252
|
export type MonitorStateFilter = MonitorState | 'all';
|
|
1234
1253
|
|
|
@@ -1243,6 +1262,8 @@ export type MonitorListEntry = {
|
|
|
1243
1262
|
state?: MonitorState;
|
|
1244
1263
|
/** @deprecated Use state. `inactive` is projected as `disabled`. */
|
|
1245
1264
|
status?: string;
|
|
1265
|
+
/** Present only while `state` is `errored`. */
|
|
1266
|
+
failure?: MonitorFailure;
|
|
1246
1267
|
tool?: string;
|
|
1247
1268
|
/** Generic provider-authored event category for this deployed monitor. */
|
|
1248
1269
|
type?: string;
|
|
@@ -1310,6 +1331,8 @@ export type MonitorsLedgerOptions = {
|
|
|
1310
1331
|
signals?: string[];
|
|
1311
1332
|
/** A Play definition id, or `none` for monitors no Play listens to. */
|
|
1312
1333
|
play?: string;
|
|
1334
|
+
/** A Monitor Fleet id: only the monitors that fleet owns. */
|
|
1335
|
+
fleet?: string;
|
|
1313
1336
|
/** `findings` orders by the most findings in `window`. */
|
|
1314
1337
|
sort?: 'recent' | 'installed' | 'name' | 'findings';
|
|
1315
1338
|
/** The span each row's findings count covers; `30d` by default. */
|
|
@@ -1585,6 +1608,40 @@ export type MonitorFleetGetOptions = {
|
|
|
1585
1608
|
limit?: number;
|
|
1586
1609
|
};
|
|
1587
1610
|
|
|
1611
|
+
/** Options for `client.monitors.fleets.overview(...)` without a fleet id. */
|
|
1612
|
+
export type MonitorFleetOverviewOptions = {
|
|
1613
|
+
/** Search fleet ids, source tables, member tools and signals. */
|
|
1614
|
+
q?: string;
|
|
1615
|
+
/**
|
|
1616
|
+
* Customer statuses to include: needs_attention, paused_credits,
|
|
1617
|
+
* paused_cap, paused_billing, setting_up, running, deactivated. Every
|
|
1618
|
+
* status except deactivated by default.
|
|
1619
|
+
*/
|
|
1620
|
+
states?: string[];
|
|
1621
|
+
/** `attention` (default) puts the fleet needing the most attention first. */
|
|
1622
|
+
sort?: 'attention' | 'findings' | 'newest' | 'name';
|
|
1623
|
+
/** The span each fleet's findings count covers; `30d` by default. */
|
|
1624
|
+
window?: '1d' | '7d' | '30d' | '90d' | '1y';
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
/** Options for `client.monitors.fleets.overview(fleetId, ...)`. */
|
|
1628
|
+
export type MonitorFleetOverviewDetailOptions = Pick<
|
|
1629
|
+
MonitorFleetOverviewOptions,
|
|
1630
|
+
'window'
|
|
1631
|
+
>;
|
|
1632
|
+
|
|
1633
|
+
/** Options for `client.monitors.fleets.issues(...)`. */
|
|
1634
|
+
export type MonitorFleetIssuesOptions = {
|
|
1635
|
+
/** Only failed, blocked, or waiting (rate-limited) members. */
|
|
1636
|
+
group?: 'failed' | 'blocked' | 'waiting';
|
|
1637
|
+
/** One cause, as the fleet overview's `issues` counts name it. */
|
|
1638
|
+
cause?: string;
|
|
1639
|
+
/** Continue from a prior page's `next_cursor`. */
|
|
1640
|
+
cursor?: string;
|
|
1641
|
+
/** Rows per page, 1 to 100 (server default 25). */
|
|
1642
|
+
limit?: number;
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1588
1645
|
export type MonitorFleetDeactivateOptions = {
|
|
1589
1646
|
/** Return the blast radius without deactivating anything. */
|
|
1590
1647
|
dryRun?: boolean;
|
|
@@ -1702,6 +1759,19 @@ export type MonitorFleetsNamespace = {
|
|
|
1702
1759
|
) => Promise<MonitorFleetResult>;
|
|
1703
1760
|
/** Every fleet in the workspace. */
|
|
1704
1761
|
list: () => Promise<MonitorFleetResult>;
|
|
1762
|
+
/**
|
|
1763
|
+
* The Fleets page: every fleet's customer status, issue counts and findings
|
|
1764
|
+
* (searched, filtered, sorted), or one fleet's overview when an id is given.
|
|
1765
|
+
*/
|
|
1766
|
+
overview: (
|
|
1767
|
+
fleetId?: string,
|
|
1768
|
+
options?: MonitorFleetOverviewOptions,
|
|
1769
|
+
) => Promise<MonitorFleetResult>;
|
|
1770
|
+
/** One page of a fleet's members that are not live, with cause and message. */
|
|
1771
|
+
issues: (
|
|
1772
|
+
fleetId: string,
|
|
1773
|
+
options?: MonitorFleetIssuesOptions,
|
|
1774
|
+
) => Promise<MonitorFleetResult>;
|
|
1705
1775
|
/** Deactivate a fleet and the monitors it owns. */
|
|
1706
1776
|
deactivate: (
|
|
1707
1777
|
fleetId: string,
|
|
@@ -1948,8 +2018,8 @@ export type MonitorsNamespace = {
|
|
|
1948
2018
|
options?: MonitorLifecycleOptions,
|
|
1949
2019
|
) => Promise<MonitorJobResult | MonitorDeployResult>;
|
|
1950
2020
|
/** List deployed monitors (active by default). Use `state` to filter the
|
|
1951
|
-
*
|
|
1952
|
-
* `disabled`); `status` is retained for older servers.
|
|
2021
|
+
* five customer states (`active`, `provisioning`, `billing_suspended`,
|
|
2022
|
+
* `errored`, `disabled`); `status` is retained for older servers.
|
|
1953
2023
|
* `includeConsumers` requires a limit of 20 or fewer. */
|
|
1954
2024
|
list: (options?: MonitorsListOptions) => Promise<MonitorsListResult>;
|
|
1955
2025
|
/** Fetch one deployed monitor by public key with bounded current listener health. */
|
|
@@ -2532,9 +2602,13 @@ export type BillingNamespace = {
|
|
|
2532
2602
|
/** Current workspace provider benefits; discovery does not authorize a call. */
|
|
2533
2603
|
entitlements: () => Promise<BillingEntitlements>;
|
|
2534
2604
|
/** Play compute pricing and this period's sandbox minutes by day. */
|
|
2535
|
-
includedCompute: (
|
|
2605
|
+
includedCompute: (options?: {
|
|
2606
|
+
includeOverage?: boolean;
|
|
2607
|
+
}) => Promise<IncludedCompute>;
|
|
2536
2608
|
/** Turn on included compute for the workspace. It cannot be turned off again. */
|
|
2537
|
-
enableIncludedCompute: (
|
|
2609
|
+
enableIncludedCompute: (options?: {
|
|
2610
|
+
includeOverage?: boolean;
|
|
2611
|
+
}) => Promise<IncludedCompute>;
|
|
2538
2612
|
/** Charge the saved payment method and add Deepline credits to the active workspace. */
|
|
2539
2613
|
topUp: (options: {
|
|
2540
2614
|
credits: number;
|
|
@@ -2990,9 +3064,19 @@ export class DeeplineClient {
|
|
|
2990
3064
|
quote: (input) =>
|
|
2991
3065
|
this.http.post<BillingQuoteResult>('/api/v2/billing/quote', input),
|
|
2992
3066
|
entitlements: () => this.http.get('/api/v2/billing/entitlements'),
|
|
2993
|
-
includedCompute: () =>
|
|
2994
|
-
|
|
2995
|
-
|
|
3067
|
+
includedCompute: ({ includeOverage } = {}) =>
|
|
3068
|
+
this.http.get(
|
|
3069
|
+
includeOverage
|
|
3070
|
+
? '/api/v2/billing/included-compute?include_overage=true'
|
|
3071
|
+
: '/api/v2/billing/included-compute',
|
|
3072
|
+
),
|
|
3073
|
+
enableIncludedCompute: ({ includeOverage } = {}) =>
|
|
3074
|
+
this.http.post<IncludedCompute>(
|
|
3075
|
+
includeOverage
|
|
3076
|
+
? '/api/v2/billing/included-compute?include_overage=true'
|
|
3077
|
+
: '/api/v2/billing/included-compute',
|
|
3078
|
+
{},
|
|
3079
|
+
),
|
|
2996
3080
|
topUp: (options) => this.topUpBillingBalance(options),
|
|
2997
3081
|
topUpWithReceipt: (options) =>
|
|
2998
3082
|
this.topUpBillingBalanceWithReceipt(options),
|
|
@@ -3126,6 +3210,12 @@ export class DeeplineClient {
|
|
|
3126
3210
|
? this.listMonitorFleets()
|
|
3127
3211
|
: this.getMonitorFleet(fleetId, options),
|
|
3128
3212
|
list: () => this.listMonitorFleets(),
|
|
3213
|
+
overview: (fleetId, options) =>
|
|
3214
|
+
fleetId === undefined
|
|
3215
|
+
? this.listMonitorFleetOverviews(options)
|
|
3216
|
+
: this.getMonitorFleetOverview(fleetId, options),
|
|
3217
|
+
issues: (fleetId, options) =>
|
|
3218
|
+
this.listMonitorFleetIssues(fleetId, options),
|
|
3129
3219
|
deactivate: (fleetId, options) =>
|
|
3130
3220
|
this.deactivateMonitorFleet(fleetId, options),
|
|
3131
3221
|
reactivate: (fleetId, options) =>
|
|
@@ -7298,6 +7388,7 @@ export class DeeplineClient {
|
|
|
7298
7388
|
for (const signal of options?.signals ?? [])
|
|
7299
7389
|
params.append('signal', signal);
|
|
7300
7390
|
if (options?.play) params.set('play', options.play);
|
|
7391
|
+
if (options?.fleet) params.set('fleet', options.fleet);
|
|
7301
7392
|
if (options?.sort) params.set('sort', options.sort);
|
|
7302
7393
|
if (options?.window) params.set('window', options.window);
|
|
7303
7394
|
if (options?.limit !== undefined)
|
|
@@ -7742,6 +7833,52 @@ export class DeeplineClient {
|
|
|
7742
7833
|
});
|
|
7743
7834
|
}
|
|
7744
7835
|
|
|
7836
|
+
/** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
|
|
7837
|
+
async listMonitorFleetOverviews(
|
|
7838
|
+
options?: MonitorFleetOverviewOptions,
|
|
7839
|
+
): Promise<MonitorFleetResult> {
|
|
7840
|
+
const params = new URLSearchParams({ view: 'overview' });
|
|
7841
|
+
if (options?.q) params.set('q', options.q);
|
|
7842
|
+
for (const state of options?.states ?? []) params.append('state', state);
|
|
7843
|
+
if (options?.sort) params.set('sort', options.sort);
|
|
7844
|
+
if (options?.window) params.set('window', options.window);
|
|
7845
|
+
return this.http.request<MonitorFleetResult>(
|
|
7846
|
+
`/api/v2/monitors/fleets?${params.toString()}`,
|
|
7847
|
+
{ method: 'GET' },
|
|
7848
|
+
);
|
|
7849
|
+
}
|
|
7850
|
+
|
|
7851
|
+
/** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
|
|
7852
|
+
async getMonitorFleetOverview(
|
|
7853
|
+
fleetId: string,
|
|
7854
|
+
options?: MonitorFleetOverviewDetailOptions,
|
|
7855
|
+
): Promise<MonitorFleetResult> {
|
|
7856
|
+
const params = new URLSearchParams({ view: 'overview' });
|
|
7857
|
+
if (options?.window) params.set('window', options.window);
|
|
7858
|
+
return this.http.request<MonitorFleetResult>(
|
|
7859
|
+
`${this.monitorFleetPath(fleetId)}?${params.toString()}`,
|
|
7860
|
+
{ method: 'GET' },
|
|
7861
|
+
);
|
|
7862
|
+
}
|
|
7863
|
+
|
|
7864
|
+
/** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
|
|
7865
|
+
async listMonitorFleetIssues(
|
|
7866
|
+
fleetId: string,
|
|
7867
|
+
options?: MonitorFleetIssuesOptions,
|
|
7868
|
+
): Promise<MonitorFleetResult> {
|
|
7869
|
+
const params = new URLSearchParams();
|
|
7870
|
+
if (options?.group) params.set('group', options.group);
|
|
7871
|
+
if (options?.cause) params.set('cause', options.cause);
|
|
7872
|
+
if (options?.cursor) params.set('cursor', options.cursor);
|
|
7873
|
+
if (options?.limit !== undefined)
|
|
7874
|
+
params.set('limit', String(options.limit));
|
|
7875
|
+
const query = params.toString();
|
|
7876
|
+
return this.http.request<MonitorFleetResult>(
|
|
7877
|
+
`${this.monitorFleetPath(fleetId)}/issues${query ? `?${query}` : ''}`,
|
|
7878
|
+
{ method: 'GET' },
|
|
7879
|
+
);
|
|
7880
|
+
}
|
|
7881
|
+
|
|
7745
7882
|
async getMonitorFleet(
|
|
7746
7883
|
fleetId: string,
|
|
7747
7884
|
options?: MonitorFleetGetOptions,
|
|
@@ -165,6 +165,9 @@ export type {
|
|
|
165
165
|
MonitorFleetDeactivateOptions,
|
|
166
166
|
MonitorFleetReactivateOptions,
|
|
167
167
|
MonitorFleetGetOptions,
|
|
168
|
+
MonitorFleetIssuesOptions,
|
|
169
|
+
MonitorFleetOverviewDetailOptions,
|
|
170
|
+
MonitorFleetOverviewOptions,
|
|
168
171
|
MonitorFleetSyncOptions,
|
|
169
172
|
MonitorFleetStatus,
|
|
170
173
|
MonitorFleetWaitOptions,
|
|
@@ -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.507',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -85,6 +85,8 @@ export type IncludedCompute = {
|
|
|
85
85
|
included_minutes_used: number;
|
|
86
86
|
/** Exact Deepline credits consumed from included compute; older servers may omit it. */
|
|
87
87
|
included_credits_used?: number;
|
|
88
|
+
/** Settled plan-rate sandbox credits paid beyond included compute this period. */
|
|
89
|
+
overage_credits?: number;
|
|
88
90
|
minutes_used: number;
|
|
89
91
|
days: Array<{ day: string; minutes: number }>;
|
|
90
92
|
/** Same settled sessions and allowance period for every value. */
|
|
@@ -23,7 +23,17 @@ import {
|
|
|
23
23
|
* this off" and "we did, and here is why" must not be the same state.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* `provider` means the provider itself stopped running the monitor's resource
|
|
28
|
+
* (a TamRadar `radar_failure` after a successful create, KAR-193). The monitor
|
|
29
|
+
* is `errored`: nothing automatic revives it, and only a changed payload, which
|
|
30
|
+
* creates a fresh resource, clears it.
|
|
31
|
+
*/
|
|
32
|
+
export type MonitorDeactivationOwner =
|
|
33
|
+
| 'policy'
|
|
34
|
+
| 'fleet'
|
|
35
|
+
| 'admin'
|
|
36
|
+
| 'provider';
|
|
27
37
|
|
|
28
38
|
/**
|
|
29
39
|
* The delivery window, in days, that `monitors health` reports against.
|
|
@@ -92,6 +102,22 @@ export const MONITOR_DEACTIVATION_REASONS: readonly MonitorDeactivationReasonDef
|
|
|
92
102
|
resolution:
|
|
93
103
|
'Re-add the source row and re-sync the fleet, or leave it deactivated.',
|
|
94
104
|
},
|
|
105
|
+
{
|
|
106
|
+
id: 'provider_source_inaccessible',
|
|
107
|
+
owner: 'provider',
|
|
108
|
+
summary:
|
|
109
|
+
'Errored because the provider could not reach the source this monitor watches (source_inaccessible).',
|
|
110
|
+
resolution:
|
|
111
|
+
"Update the monitor with the source's current URL, or remove it. Resubmitting the same payload leaves it errored.",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'provider_resource_failed',
|
|
115
|
+
owner: 'provider',
|
|
116
|
+
summary:
|
|
117
|
+
'Errored because the provider failed this monitor twice in a row.',
|
|
118
|
+
resolution:
|
|
119
|
+
'Update or remove the monitor. Resubmitting the same payload leaves it errored.',
|
|
120
|
+
},
|
|
95
121
|
];
|
|
96
122
|
|
|
97
123
|
const BY_ID = new Map(
|
|
@@ -132,6 +158,17 @@ export function isPolicyDeactivation(id: string | undefined | null): boolean {
|
|
|
132
158
|
return monitorDeactivationReason(id)?.owner === 'policy';
|
|
133
159
|
}
|
|
134
160
|
|
|
161
|
+
/**
|
|
162
|
+
* True when the provider failed the monitor's resource and the monitor is
|
|
163
|
+
* `errored` (KAR-193). Automatic audit, repair and policy recovery leave it
|
|
164
|
+
* alone; a payload change is the only way back.
|
|
165
|
+
*/
|
|
166
|
+
export function isProviderErroredDeactivation(
|
|
167
|
+
id: string | undefined | null,
|
|
168
|
+
): boolean {
|
|
169
|
+
return monitorDeactivationReason(id)?.owner === 'provider';
|
|
170
|
+
}
|
|
171
|
+
|
|
135
172
|
/** Both policy and admin shutdown retain the definition; only policy owns recovery. */
|
|
136
173
|
export function isMonitorSuspension(id: string | undefined | null): boolean {
|
|
137
174
|
const owner = monitorDeactivationReason(id)?.owner;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a fleet member is not live, in a closed vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* The fleet page groups problem members by cause and pairs each cause with its
|
|
5
|
+
* fix. Grouping by the raw provider message would grow with membership (a
|
|
6
|
+
* message can name the member's own resource), so every member maps to one of
|
|
7
|
+
* a fixed set of causes and the summary is a fixed-size set of counts. The raw
|
|
8
|
+
* message stays on the paginated issue detail.
|
|
9
|
+
*
|
|
10
|
+
* Failed causes are read from the prefixes our own convergence code writes
|
|
11
|
+
* (`fleets/service.ts`, `describeProviderMonitorBatchItemFailure`); anything
|
|
12
|
+
* else is `other`. Blocked causes come from the refusal codes. Finer provider
|
|
13
|
+
* causes need retained real provider responses (KAR-196).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { FLEET_BLOCKED_BY, FLEET_REFUSAL } from './limits';
|
|
17
|
+
|
|
18
|
+
export const FLEET_ISSUE_GROUPS = ['failed', 'blocked', 'waiting'] as const;
|
|
19
|
+
export type FleetIssueGroup = (typeof FLEET_ISSUE_GROUPS)[number];
|
|
20
|
+
|
|
21
|
+
export const FLEET_FAILED_CAUSES = [
|
|
22
|
+
'provider_rejected',
|
|
23
|
+
'provider_unconfirmed',
|
|
24
|
+
'provider_state_mismatch',
|
|
25
|
+
'billing',
|
|
26
|
+
'unsupported_tool',
|
|
27
|
+
'other',
|
|
28
|
+
] as const;
|
|
29
|
+
export type FleetFailedCause = (typeof FLEET_FAILED_CAUSES)[number];
|
|
30
|
+
|
|
31
|
+
export const FLEET_BLOCKED_CAUSES = [
|
|
32
|
+
'watched_accounts_limit',
|
|
33
|
+
'monitors_per_account_limit',
|
|
34
|
+
'rollout_access',
|
|
35
|
+
'identity_occupied',
|
|
36
|
+
'unsupported_tool',
|
|
37
|
+
'needs_support',
|
|
38
|
+
'unknown_code',
|
|
39
|
+
] as const;
|
|
40
|
+
export type FleetBlockedCause = (typeof FLEET_BLOCKED_CAUSES)[number];
|
|
41
|
+
|
|
42
|
+
export const FLEET_WAITING_CAUSES = ['rate_limited'] as const;
|
|
43
|
+
export type FleetWaitingCause = (typeof FLEET_WAITING_CAUSES)[number];
|
|
44
|
+
|
|
45
|
+
export type FleetIssueCause =
|
|
46
|
+
| FleetFailedCause
|
|
47
|
+
| FleetBlockedCause
|
|
48
|
+
| FleetWaitingCause;
|
|
49
|
+
|
|
50
|
+
export type FleetIssueMember = {
|
|
51
|
+
convergence:
|
|
52
|
+
| 'pending'
|
|
53
|
+
| 'submitting'
|
|
54
|
+
| 'rate_limited'
|
|
55
|
+
| 'settled'
|
|
56
|
+
| 'blocked'
|
|
57
|
+
| 'failed'
|
|
58
|
+
| null;
|
|
59
|
+
blockedBy: string | null;
|
|
60
|
+
error: string | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type FleetMemberIssue =
|
|
64
|
+
| { group: 'failed'; cause: FleetFailedCause }
|
|
65
|
+
| { group: 'blocked'; cause: FleetBlockedCause }
|
|
66
|
+
| { group: 'waiting'; cause: FleetWaitingCause };
|
|
67
|
+
|
|
68
|
+
const FAILED_PREFIXES: ReadonlyArray<[string, FleetFailedCause]> = [
|
|
69
|
+
['provider acceptance unknown', 'provider_unconfirmed'],
|
|
70
|
+
['provider accepted ', 'provider_unconfirmed'],
|
|
71
|
+
['Monitor create could not be charged', 'billing'],
|
|
72
|
+
['Monitor tool ', 'unsupported_tool'],
|
|
73
|
+
['Provider resource ', 'provider_state_mismatch'],
|
|
74
|
+
['The provider holds radar', 'provider_state_mismatch'],
|
|
75
|
+
['This member is bound to radar', 'provider_state_mismatch'],
|
|
76
|
+
['The provider accepted the delete', 'provider_state_mismatch'],
|
|
77
|
+
['The provider returned an unrecognized', 'provider_state_mismatch'],
|
|
78
|
+
['The provider rejected this monitor.', 'provider_rejected'],
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
/** `describeProviderMonitorBatchItemFailure` appends `— code=…` or field reasons. */
|
|
82
|
+
const PROVIDER_REJECTION_DETAIL = / — (code=|[\w.[\]]+: )/;
|
|
83
|
+
|
|
84
|
+
export function classifyFleetFailure(error: string | null): FleetFailedCause {
|
|
85
|
+
const message = error?.trim() ?? '';
|
|
86
|
+
for (const [prefix, cause] of FAILED_PREFIXES) {
|
|
87
|
+
if (message.startsWith(prefix)) return cause;
|
|
88
|
+
}
|
|
89
|
+
return PROVIDER_REJECTION_DETAIL.test(message) ? 'provider_rejected' : 'other';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const BLOCKED_CAUSES: Readonly<Record<string, FleetBlockedCause>> = {
|
|
93
|
+
[FLEET_BLOCKED_BY.watchedEntities]: 'watched_accounts_limit',
|
|
94
|
+
[FLEET_BLOCKED_BY.monitorsPerEntity]: 'monitors_per_account_limit',
|
|
95
|
+
[FLEET_BLOCKED_BY.rolloutAccess]: 'rollout_access',
|
|
96
|
+
[FLEET_REFUSAL.identityOccupied]: 'identity_occupied',
|
|
97
|
+
[FLEET_REFUSAL.batchUnsupported]: 'unsupported_tool',
|
|
98
|
+
[FLEET_REFUSAL.orphanedResource]: 'needs_support',
|
|
99
|
+
[FLEET_REFUSAL.resourceOwnedByOtherOrg]: 'needs_support',
|
|
100
|
+
[FLEET_REFUSAL.resourceBindingConflict]: 'needs_support',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export function classifyFleetBlock(
|
|
104
|
+
blockedBy: string | null,
|
|
105
|
+
): FleetBlockedCause {
|
|
106
|
+
return (blockedBy && BLOCKED_CAUSES[blockedBy]) || 'unknown_code';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** The member's issue, or null when it is live or still being set up. */
|
|
110
|
+
export function classifyFleetMemberIssue(
|
|
111
|
+
member: FleetIssueMember,
|
|
112
|
+
): FleetMemberIssue | null {
|
|
113
|
+
switch (member.convergence) {
|
|
114
|
+
case 'failed':
|
|
115
|
+
return { group: 'failed', cause: classifyFleetFailure(member.error) };
|
|
116
|
+
case 'blocked':
|
|
117
|
+
return { group: 'blocked', cause: classifyFleetBlock(member.blockedBy) };
|
|
118
|
+
case 'rate_limited':
|
|
119
|
+
return { group: 'waiting', cause: 'rate_limited' };
|
|
120
|
+
default:
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type FleetIssueSummary = {
|
|
126
|
+
total: number;
|
|
127
|
+
failed: { total: number; causes: Record<FleetFailedCause, number> };
|
|
128
|
+
blocked: { total: number; causes: Record<FleetBlockedCause, number> };
|
|
129
|
+
waiting: { total: number; next_attempt_at: number | null };
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
function zeroes<T extends string>(keys: readonly T[]): Record<T, number> {
|
|
133
|
+
return Object.fromEntries(keys.map((key) => [key, 0])) as Record<T, number>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function emptyFleetIssueSummary(): FleetIssueSummary {
|
|
137
|
+
return {
|
|
138
|
+
total: 0,
|
|
139
|
+
failed: { total: 0, causes: zeroes(FLEET_FAILED_CAUSES) },
|
|
140
|
+
blocked: { total: 0, causes: zeroes(FLEET_BLOCKED_CAUSES) },
|
|
141
|
+
waiting: { total: 0, next_attempt_at: null },
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Fixed-size counts by group and cause. `total` counts failed and blocked
|
|
147
|
+
* members only: a rate-limited member retries on its own and needs nothing.
|
|
148
|
+
*/
|
|
149
|
+
export function summarizeFleetIssues(
|
|
150
|
+
members: Iterable<FleetIssueMember & { nextAttemptAt?: number | null }>,
|
|
151
|
+
): FleetIssueSummary {
|
|
152
|
+
const summary = emptyFleetIssueSummary();
|
|
153
|
+
for (const member of members) {
|
|
154
|
+
const issue = classifyFleetMemberIssue(member);
|
|
155
|
+
if (!issue) continue;
|
|
156
|
+
if (issue.group === 'failed') {
|
|
157
|
+
summary.failed.total += 1;
|
|
158
|
+
summary.failed.causes[issue.cause] += 1;
|
|
159
|
+
} else if (issue.group === 'blocked') {
|
|
160
|
+
summary.blocked.total += 1;
|
|
161
|
+
summary.blocked.causes[issue.cause] += 1;
|
|
162
|
+
} else {
|
|
163
|
+
summary.waiting.total += 1;
|
|
164
|
+
const next = member.nextAttemptAt ?? null;
|
|
165
|
+
if (
|
|
166
|
+
next !== null &&
|
|
167
|
+
(summary.waiting.next_attempt_at === null ||
|
|
168
|
+
next < summary.waiting.next_attempt_at)
|
|
169
|
+
) {
|
|
170
|
+
summary.waiting.next_attempt_at = next;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
summary.total = summary.failed.total + summary.blocked.total;
|
|
175
|
+
return summary;
|
|
176
|
+
}
|
|
@@ -6,5 +6,22 @@ export const FLEET_BLOCKED_BY = {
|
|
|
6
6
|
monitorsPerEntity: OrgLimit.MonitorsPerEntity,
|
|
7
7
|
rolloutAccess: 'monitor.rollout_access',
|
|
8
8
|
} as const;
|
|
9
|
+
/** Refusals a fleet's provider work records on a member it could not create. */
|
|
10
|
+
export const FLEET_REFUSAL = {
|
|
11
|
+
batchUnsupported: 'provider.batch_create_unsupported',
|
|
12
|
+
identityOccupied: 'provider.identity_occupied',
|
|
13
|
+
/** Created, unbillable, and its deletion could not be confirmed. */
|
|
14
|
+
orphanedResource: 'provider.orphaned_resource',
|
|
15
|
+
/**
|
|
16
|
+
* The provider holds a matching resource, but another Deepline organization
|
|
17
|
+
* created it. Adopting it would cross-wire two customers.
|
|
18
|
+
*/
|
|
19
|
+
resourceOwnedByOtherOrg: 'provider.resource_owned_by_other_org',
|
|
20
|
+
/**
|
|
21
|
+
* The member's binding and its row name different provider resources, so a
|
|
22
|
+
* removal cannot prove which radar it is deleting.
|
|
23
|
+
*/
|
|
24
|
+
resourceBindingConflict: 'provider.resource_binding_conflict',
|
|
25
|
+
} as const;
|
|
9
26
|
export const MAX_MEMBER_DEFINITION_BYTES = 2_048;
|
|
10
27
|
export const MAX_FLEET_SETTLE_ITEMS = 100;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fleet as the Fleets list presents it: one status a customer can act on,
|
|
3
|
+
* and the order that puts the fleet needing the most attention first.
|
|
4
|
+
*
|
|
5
|
+
* The verdict (`verdict.ts`) says what convergence is doing. This says what the
|
|
6
|
+
* customer should do about it, so a fleet that converged with members it could
|
|
7
|
+
* not create reads "needs attention", not "running".
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { monitorPauseKind } from '@deepline/monitors/billing/credit-recovery';
|
|
11
|
+
import type { FleetLifecycleStatus, FleetStatusVerdict } from './verdict';
|
|
12
|
+
|
|
13
|
+
export const FLEET_OVERVIEW_STATUSES = [
|
|
14
|
+
'needs_attention',
|
|
15
|
+
'paused_credits',
|
|
16
|
+
'paused_cap',
|
|
17
|
+
'paused_billing',
|
|
18
|
+
'setting_up',
|
|
19
|
+
'running',
|
|
20
|
+
'deactivated',
|
|
21
|
+
] as const;
|
|
22
|
+
export type FleetOverviewStatus = (typeof FLEET_OVERVIEW_STATUSES)[number];
|
|
23
|
+
|
|
24
|
+
/** Every status but deactivated: the list's default. */
|
|
25
|
+
export const FLEET_OVERVIEW_DEFAULT_STATUSES: readonly FleetOverviewStatus[] =
|
|
26
|
+
FLEET_OVERVIEW_STATUSES.filter((status) => status !== 'deactivated');
|
|
27
|
+
|
|
28
|
+
export function isFleetOverviewStatus(
|
|
29
|
+
value: unknown,
|
|
30
|
+
): value is FleetOverviewStatus {
|
|
31
|
+
return (FLEET_OVERVIEW_STATUSES as readonly unknown[]).includes(value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function fleetOverviewStatus(input: {
|
|
35
|
+
lifecycle: FleetLifecycleStatus;
|
|
36
|
+
verdict: FleetStatusVerdict;
|
|
37
|
+
/** Failed plus blocked members. */
|
|
38
|
+
issues: number;
|
|
39
|
+
/** Members the last provider check found missing or inactive. */
|
|
40
|
+
missingAtProvider: number;
|
|
41
|
+
billingSuspensionReason?: string | null;
|
|
42
|
+
}): FleetOverviewStatus {
|
|
43
|
+
switch (input.lifecycle) {
|
|
44
|
+
case 'deactivating':
|
|
45
|
+
case 'deactivated':
|
|
46
|
+
return 'deactivated';
|
|
47
|
+
case 'billing_suspending':
|
|
48
|
+
case 'billing_suspended':
|
|
49
|
+
case 'billing_reactivating': {
|
|
50
|
+
const kind = monitorPauseKind(input.billingSuspensionReason ?? undefined);
|
|
51
|
+
return kind === 'credits'
|
|
52
|
+
? 'paused_credits'
|
|
53
|
+
: kind === 'cap'
|
|
54
|
+
? 'paused_cap'
|
|
55
|
+
: 'paused_billing';
|
|
56
|
+
}
|
|
57
|
+
case 'active':
|
|
58
|
+
if (
|
|
59
|
+
input.issues > 0 ||
|
|
60
|
+
input.missingAtProvider > 0 ||
|
|
61
|
+
input.verdict === 'degraded'
|
|
62
|
+
) {
|
|
63
|
+
return 'needs_attention';
|
|
64
|
+
}
|
|
65
|
+
return input.verdict === 'converged' ? 'running' : 'setting_up';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const ATTENTION_RANK: Record<FleetOverviewStatus, number> = {
|
|
70
|
+
needs_attention: 0,
|
|
71
|
+
paused_credits: 1,
|
|
72
|
+
paused_cap: 1,
|
|
73
|
+
paused_billing: 1,
|
|
74
|
+
setting_up: 2,
|
|
75
|
+
running: 3,
|
|
76
|
+
deactivated: 4,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const FLEET_OVERVIEW_SORTS = [
|
|
80
|
+
'attention',
|
|
81
|
+
'findings',
|
|
82
|
+
'newest',
|
|
83
|
+
'name',
|
|
84
|
+
] as const;
|
|
85
|
+
export type FleetOverviewSort = (typeof FLEET_OVERVIEW_SORTS)[number];
|
|
86
|
+
|
|
87
|
+
export function isFleetOverviewSort(value: unknown): value is FleetOverviewSort {
|
|
88
|
+
return (FLEET_OVERVIEW_SORTS as readonly unknown[]).includes(value);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type FleetOverviewSortKey = {
|
|
92
|
+
id: string;
|
|
93
|
+
status: FleetOverviewStatus;
|
|
94
|
+
issues: number;
|
|
95
|
+
/** Null when no member has a findings row. Sorts below zero. */
|
|
96
|
+
findings: number | null;
|
|
97
|
+
createdAt: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export function compareFleetOverviews(sort: FleetOverviewSort) {
|
|
101
|
+
return (left: FleetOverviewSortKey, right: FleetOverviewSortKey): number => {
|
|
102
|
+
const byName = left.id.localeCompare(right.id);
|
|
103
|
+
switch (sort) {
|
|
104
|
+
case 'attention':
|
|
105
|
+
return (
|
|
106
|
+
ATTENTION_RANK[left.status] - ATTENTION_RANK[right.status] ||
|
|
107
|
+
right.issues - left.issues ||
|
|
108
|
+
byName
|
|
109
|
+
);
|
|
110
|
+
case 'findings':
|
|
111
|
+
return (right.findings ?? -1) - (left.findings ?? -1) || byName;
|
|
112
|
+
case 'newest':
|
|
113
|
+
return right.createdAt - left.createdAt || byName;
|
|
114
|
+
case 'name':
|
|
115
|
+
return byName;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|