deepline 0.3.491 → 0.3.493
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 +11 -5
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +25 -9
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +54 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +5 -4
- package/dist/bundling-sources/shared_libs/play-runtime/crustdata-company-identify-batching.ts +162 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +19 -3
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +17 -23
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +28 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +293 -110
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +75 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +412 -59
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +38 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +19 -11
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +165 -12
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +358 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +104 -2
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +7 -2
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +4 -0
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +13 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +49 -10
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +22 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +6 -1
- package/dist/cli/{auth-FXAC472Y.mjs → auth-3NAY3AST.mjs} +5 -5
- package/dist/cli/auth-KYQLDI6V.js +43 -0
- package/dist/cli/{billing-PDOA3KZ3.js → billing-FSB4BBBO.js} +80 -80
- package/dist/cli/{billing-UM4LE33K.mjs → billing-SBWQCC7B.mjs} +7 -7
- package/dist/cli/{chunk-HSJK6EMU.mjs → chunk-2BRTYIAH.mjs} +23 -9
- package/dist/cli/{chunk-B2TXKEED.js → chunk-2H4OFVR5.js} +5 -5
- package/dist/cli/{chunk-BCKIBVEJ.js → chunk-2I7VN65H.js} +10 -10
- package/dist/cli/{chunk-LMG7O6XJ.mjs → chunk-2IHGVAGT.mjs} +2 -2
- package/dist/cli/{chunk-5KMGKG4B.js → chunk-2NGIBJM2.js} +8 -8
- package/dist/cli/{chunk-2MW6TGNZ.mjs → chunk-3QGUWB6E.mjs} +4 -4
- package/dist/cli/{chunk-ORKLMANE.mjs → chunk-4IJFQV3O.mjs} +1 -1
- package/dist/cli/{chunk-PIPEPCRL.mjs → chunk-4NIGNT7X.mjs} +1 -1
- package/dist/cli/{chunk-H6UIS36S.mjs → chunk-5DIZ2G74.mjs} +2 -2
- package/dist/cli/{chunk-TKLDKIJU.mjs → chunk-5JPKRDFC.mjs} +7 -5
- package/dist/cli/{chunk-FTXIJTV2.mjs → chunk-5WOPBX3H.mjs} +1 -1
- package/dist/cli/{chunk-KGJVDR4Q.mjs → chunk-67ZG7XZV.mjs} +3 -3
- package/dist/cli/{chunk-DUFRH43S.js → chunk-7HABWOMB.js} +261 -261
- package/dist/cli/{chunk-MN6DCV63.js → chunk-AGTXL6LZ.js} +5 -5
- package/dist/cli/{chunk-Q7G7CU4W.js → chunk-AWMCZAUR.js} +3 -3
- package/dist/cli/{chunk-HHTVRICE.js → chunk-C2MRDPA5.js} +17 -17
- package/dist/cli/{chunk-ONONSV2Q.mjs → chunk-DVQHG6AM.mjs} +1 -0
- package/dist/cli/{chunk-O3K22ZC7.js → chunk-DWJ4RXSA.js} +34 -11
- package/dist/cli/{chunk-MAM6ZOVS.mjs → chunk-DYP27IWC.mjs} +99 -24
- package/dist/cli/{chunk-NUOKAKZW.mjs → chunk-E5ILCMKQ.mjs} +1 -1
- package/dist/cli/{chunk-OLHWZM4A.mjs → chunk-EBAS3UT2.mjs} +6 -6
- package/dist/cli/{chunk-74H5OTRM.js → chunk-EFO5GVYS.js} +1 -1
- package/dist/cli/{chunk-X7YOVJBC.js → chunk-EYG336YV.js} +132 -57
- package/dist/cli/{chunk-YV4DP6KQ.mjs → chunk-GSC35TPZ.mjs} +2 -2
- package/dist/cli/{chunk-EPD7NSDJ.mjs → chunk-HLM2UFQ5.mjs} +13 -5
- package/dist/cli/{chunk-IG3GSBBE.js → chunk-HTUSTPP4.js} +32 -32
- package/dist/cli/{chunk-CFPFTS3A.mjs → chunk-IJJ6D5WL.mjs} +12 -12
- package/dist/cli/{chunk-TH7JLR5D.js → chunk-IJOHWGPF.js} +6 -6
- package/dist/cli/{chunk-RFSXXDH7.js → chunk-IOBPR2VO.js} +17 -17
- package/dist/cli/{chunk-HNG2U3IG.js → chunk-IOMEJKGK.js} +2 -2
- package/dist/cli/{chunk-A7ZMG2QZ.mjs → chunk-IRDYBMA7.mjs} +34 -11
- package/dist/cli/{chunk-ZEZ3CZ3X.js → chunk-JO2JZUBR.js} +3 -3
- package/dist/cli/{chunk-4IP5MLWU.js → chunk-JO5FFSR7.js} +6 -1
- package/dist/cli/{chunk-SJOHQ2WW.js → chunk-KCDZWS2B.js} +56 -56
- package/dist/cli/{chunk-CGDUFVNE.mjs → chunk-KGDDQMI7.mjs} +2 -2
- package/dist/cli/{chunk-OYJTLEB4.mjs → chunk-KKSKYZO4.mjs} +1 -1
- package/dist/cli/{chunk-TMAS3WH3.js → chunk-LGTZYI5B.js} +21 -21
- package/dist/cli/{chunk-SUMKWA53.js → chunk-MLEUOTEQ.js} +73 -59
- package/dist/cli/{chunk-3WRWPNHE.mjs → chunk-NALJJTPS.mjs} +5 -5
- package/dist/cli/{chunk-27MRSV6O.js → chunk-NPNAEPY4.js} +26 -26
- package/dist/cli/{chunk-AEKJZJ4R.js → chunk-NWIDPT7H.js} +4 -4
- package/dist/cli/{chunk-AUQQVDAB.js → chunk-PKV5CD3W.js} +1 -0
- package/dist/cli/{chunk-3FMU6F6E.js → chunk-QTPS5RLG.js} +15 -15
- package/dist/cli/{chunk-4OLXMJ2L.js → chunk-RLX5ZFNX.js} +8 -6
- package/dist/cli/{chunk-DEJIN4DF.mjs → chunk-SAW3FBCA.mjs} +5 -0
- package/dist/cli/{chunk-S4CYM4EC.mjs → chunk-SXD2EYAH.mjs} +6 -6
- package/dist/cli/{chunk-YNWET57Z.js → chunk-TIFRRLZT.js} +7 -7
- package/dist/cli/{chunk-6PMM7VJN.mjs → chunk-TNQOR6XQ.mjs} +1 -1
- package/dist/cli/{chunk-6UARNRXT.js → chunk-UCMY2SO2.js} +23 -15
- package/dist/cli/{chunk-X75ONMDJ.mjs → chunk-VFHIYWMC.mjs} +5 -5
- package/dist/cli/{chunk-ZX2FXZJN.js → chunk-WCZFCOMZ.js} +7 -7
- package/dist/cli/{chunk-IIO7UOVW.mjs → chunk-WTFI7BVH.mjs} +3 -3
- package/dist/cli/{chunk-I64PYCTB.js → chunk-XLE7KXE7.js} +2 -2
- package/dist/cli/{chunk-CRBBGKRH.js → chunk-XQX476QK.js} +14 -14
- package/dist/cli/{chunk-WCWVXN3R.mjs → chunk-Y3NN2UAF.mjs} +2 -2
- package/dist/cli/{chunk-3K4IAV7I.mjs → chunk-ZQH4TXM2.mjs} +2 -2
- package/dist/cli/{chunk-VC3SH4QW.mjs → chunk-ZVW7EWTC.mjs} +7 -7
- package/dist/cli/{chunk-QBOE5LEH.mjs → chunk-ZVXB7OU7.mjs} +1 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-IGPAPAES.js → csv-DKYZE2KM.js} +13 -13
- package/dist/cli/{csv-RNMQHECI.mjs → csv-XR22YQXT.mjs} +4 -4
- package/dist/cli/{db-CKMVVGXJ.mjs → db-EOKG36YN.mjs} +7 -7
- package/dist/cli/{db-32OXM3TO.js → db-RNYRTCMV.js} +28 -28
- package/dist/cli/describe-ICFXOQBW.mjs +50 -0
- package/dist/cli/describe-RS75I33X.js +50 -0
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +4 -4
- package/dist/cli/describe-core.mjs +3 -3
- package/dist/cli/{executions-S4M4JMCU.mjs → executions-3RAOACNS.mjs} +7 -7
- package/dist/cli/{executions-PCZS7B2M.js → executions-OBWPSWH7.js} +9 -9
- package/dist/cli/{feedback-FGUJVCBS.mjs → feedback-6EQRVBKF.mjs} +4 -4
- package/dist/cli/{feedback-6EGKPZ3U.js → feedback-6GPEUBLF.js} +8 -8
- package/dist/cli/getting-started.d.mts +12 -10
- package/dist/cli/getting-started.d.ts +12 -10
- package/dist/cli/getting-started.js +4 -2
- package/dist/cli/getting-started.mjs +3 -1
- package/dist/cli/{git-LR4ARG5H.mjs → git-CVQ24DTR.mjs} +5 -5
- package/dist/cli/git-DEFE4SSB.js +25 -0
- package/dist/cli/index.js +143 -143
- package/dist/cli/index.mjs +43 -43
- package/dist/cli/{legacy-noops-S37PJ7OJ.mjs → legacy-noops-QULJZYNH.mjs} +5 -5
- package/dist/cli/{legacy-noops-VX4JEQR6.js → legacy-noops-XPOATG5V.js} +8 -8
- package/dist/cli/{monitors-H3AX6CZG.mjs → monitors-AFT5YJPZ.mjs} +49 -9
- package/dist/cli/{monitors-ADASJI72.js → monitors-OJ4CMREE.js} +169 -129
- package/dist/cli/{org-ZRJ3C56J.js → org-RKT52CSL.js} +73 -73
- package/dist/cli/{org-D3F5LUDW.mjs → org-WHKNXANG.mjs} +7 -7
- package/dist/cli/{pages-PSHU366M.mjs → pages-EEAQFGVD.mjs} +7 -7
- package/dist/cli/{pages-5TKO3644.js → pages-SOE3R667.js} +18 -18
- package/dist/cli/{play-AUDDK7XB.mjs → play-LXFWHUBP.mjs} +147 -52
- package/dist/cli/{play-VDAETQDI.js → play-OTJJ4E4T.js} +661 -566
- package/dist/cli/{providers-IURPWRWD.js → providers-RU4HIAT3.js} +10 -10
- package/dist/cli/{providers-X7YMZSKQ.mjs → providers-U3CPKTMM.mjs} +7 -7
- package/dist/cli/{quickstart-6AGWVFNX.mjs → quickstart-75AO2AJC.mjs} +5 -5
- package/dist/cli/{quickstart-Y6GFXLDV.js → quickstart-N72IVA2Y.js} +13 -13
- package/dist/cli/{run-TG7J45NS.mjs → run-IGWFL6WH.mjs} +29 -28
- package/dist/cli/{run-TQFGOXNT.js → run-MMYES3IW.js} +44 -43
- package/dist/cli/search-EQURI7SZ.js +32 -0
- package/dist/cli/{search-3G4J2GC6.mjs → search-FIYESBLZ.mjs} +8 -8
- package/dist/cli/{search-output-NPZICK5C.js → search-output-2FXN4ZWD.js} +9 -6
- package/dist/cli/{search-output-ZGNHDCLL.mjs → search-output-3I5KSW36.mjs} +7 -4
- package/dist/cli/{secrets-KTTHT4ZG.js → secrets-HCZQ6JNP.js} +16 -16
- package/dist/cli/{secrets-EAWJBRUD.mjs → secrets-O7IUQ3VT.mjs} +7 -7
- package/dist/cli/{sessions-S4YVBPAW.js → sessions-5AYTT4IW.js} +6 -6
- package/dist/cli/{sessions-D4Q3LCEQ.mjs → sessions-KY7A3EZO.mjs} +5 -5
- package/dist/cli/{settings-BAK3VOWW.js → settings-P4VFYWJK.js} +80 -80
- package/dist/cli/{settings-JUORW6NL.mjs → settings-WSMRR2GS.mjs} +13 -13
- package/dist/cli/{setup-NJPHTW32.js → setup-J7CA3EJL.js} +57 -57
- package/dist/cli/{setup-AXFGCXJE.mjs → setup-YTVKVQC7.mjs} +13 -13
- package/dist/cli/skills-KKPEGLAR.js +36 -0
- package/dist/cli/{skills-SKJVDJEF.mjs → skills-W5WY764N.mjs} +10 -10
- package/dist/cli/tools-65Y4QTW6.js +57 -0
- package/dist/cli/{tools-63THJVJZ.mjs → tools-YECI6N3N.mjs} +20 -20
- package/dist/cli/{update-KSID5F74.mjs → update-BIFBIEII.mjs} +10 -10
- package/dist/cli/update-WDG7VFOW.js +34 -0
- package/dist/cli/{workflow-BLSMWBKW.js → workflow-D2TUFFH6.js} +18 -18
- package/dist/cli/{workflow-C4B54X2Z.mjs → workflow-XZVDNARC.mjs} +8 -8
- package/dist/{client-CQgGFxAH.d.ts → client-BDB_VbE4.d.ts} +1 -1
- package/dist/{client-B4R1scm2.d.mts → client-CNzJ1LTF.d.mts} +1 -1
- package/dist/{client-core-DMvHWjub.d.mts → client-core-CSv3DlPD.d.mts} +76 -5
- package/dist/{client-core-BUNjKBKq.d.ts → client-core-xEa9x3pl.d.ts} +76 -5
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- package/dist/install-integrity.json +115 -114
- 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/plays/run-request.js +2 -2
- package/dist/plays/run-request.mjs +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/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-QIDL3YCW.js +0 -43
- package/dist/cli/describe-67GMIEIO.js +0 -50
- package/dist/cli/describe-QR7I3VOF.mjs +0 -50
- package/dist/cli/git-PIH5Z5LN.js +0 -25
- package/dist/cli/search-VC43NUY7.js +0 -32
- package/dist/cli/skills-4NQZISNK.js +0 -36
- package/dist/cli/tools-BAHK33FQ.js +0 -57
- package/dist/cli/update-EMIGRGJ7.js +0 -34
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
} from './workspace';
|
|
11
11
|
import {
|
|
12
12
|
notificationText,
|
|
13
|
+
notificationUsageMeterText,
|
|
13
14
|
type NotificationText,
|
|
14
15
|
type PlayRunEmailContent,
|
|
16
|
+
type NotificationUsageMeter,
|
|
15
17
|
} from './content';
|
|
16
18
|
|
|
17
19
|
export {
|
|
@@ -38,10 +40,11 @@ type ProductNotificationEmailContent = {
|
|
|
38
40
|
severity?: 'success' | 'warning' | 'error';
|
|
39
41
|
/**
|
|
40
42
|
* `thank_you` is the standard layout without the notification group header,
|
|
41
|
-
* with
|
|
42
|
-
*
|
|
43
|
+
* with compact details. `included_allowance` leads with usage meters and
|
|
44
|
+
* uses paragraphs for the details.
|
|
43
45
|
*/
|
|
44
|
-
emailFormat?: 'thank_you';
|
|
46
|
+
emailFormat?: 'thank_you' | 'included_allowance';
|
|
47
|
+
usageMeters?: NotificationUsageMeter[];
|
|
45
48
|
playRun?: PlayRunEmailContent;
|
|
46
49
|
};
|
|
47
50
|
|
|
@@ -49,6 +52,16 @@ const MAX_RECIPIENTS = 50;
|
|
|
49
52
|
const MAX_FAILURE_PREVIEW_CHARACTERS = 280;
|
|
50
53
|
const MAX_FAILURE_PREVIEW_LINES = 3;
|
|
51
54
|
|
|
55
|
+
function meterHtml(meter: NotificationUsageMeter, allowanceExhausted: boolean) {
|
|
56
|
+
const filled = Number(
|
|
57
|
+
(Math.max(0, Math.min(1, meter.used / meter.included)) * 100).toFixed(2),
|
|
58
|
+
);
|
|
59
|
+
const color =
|
|
60
|
+
allowanceExhausted || meter.used > meter.included ? '#ffbf00' : '#1919ff';
|
|
61
|
+
return `<p style="margin:0 0 ${allowanceExhausted ? '10px' : '6px'};font-size:13px;color:#525252">${escapeHtml(notificationUsageMeterText(meter))}</p>
|
|
62
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed;margin:0 0 ${allowanceExhausted ? '32px' : '18px'};background:#e5e5e5;border-radius:8px"><tr>${filled > 0 ? `<td width="${filled}%" height="8" style="background:${color};border-radius:8px;font-size:0"> </td>` : ''}${filled < 100 ? `<td height="8" style="font-size:0"> </td>` : ''}</tr></table>`;
|
|
63
|
+
}
|
|
64
|
+
|
|
52
65
|
function failurePreview(error: string): string {
|
|
53
66
|
const lines = error.split(/\r?\n/, MAX_FAILURE_PREVIEW_LINES + 1);
|
|
54
67
|
const characters = Array.from(
|
|
@@ -213,7 +226,16 @@ export function renderProductNotificationEmail(
|
|
|
213
226
|
const oneClickOptOutUrl = input.oneClickUnsubscribeUrl
|
|
214
227
|
? unsubscribeUrl(input.oneClickUnsubscribeUrl)
|
|
215
228
|
: optOutUrl;
|
|
216
|
-
const
|
|
229
|
+
const includedAllowance = input.content.emailFormat === 'included_allowance';
|
|
230
|
+
const showGroupHeader = input.content.emailFormat === undefined;
|
|
231
|
+
const meters = (input.content.usageMeters ?? []).filter(
|
|
232
|
+
(meter) =>
|
|
233
|
+
Number.isFinite(meter.used) &&
|
|
234
|
+
Number.isFinite(meter.included) &&
|
|
235
|
+
meter.included > 0,
|
|
236
|
+
);
|
|
237
|
+
const htmlMeters = meters.map((meter) => meterHtml(meter, includedAllowance));
|
|
238
|
+
const openLabel = meters.length > 0 ? 'View billing' : 'Open Deepline';
|
|
217
239
|
if (playRun && !targetUrl) {
|
|
218
240
|
throw new Error('Play run email requires a run link.');
|
|
219
241
|
}
|
|
@@ -222,10 +244,15 @@ export function renderProductNotificationEmail(
|
|
|
222
244
|
: undefined;
|
|
223
245
|
const text = [
|
|
224
246
|
input.content.title,
|
|
247
|
+
...(includedAllowance
|
|
248
|
+
? ['', ...meters.map(notificationUsageMeterText)]
|
|
249
|
+
: []),
|
|
225
250
|
...(showGroupHeader && !playRun
|
|
226
251
|
? [`Notification group: ${input.content.groupName}`]
|
|
227
252
|
: []),
|
|
228
|
-
...(targetUrl && !playRun
|
|
253
|
+
...(targetUrl && !playRun && !includedAllowance
|
|
254
|
+
? [`${openLabel}: ${targetUrl}`]
|
|
255
|
+
: []),
|
|
229
256
|
'',
|
|
230
257
|
...(playRun
|
|
231
258
|
? [
|
|
@@ -246,7 +273,11 @@ export function renderProductNotificationEmail(
|
|
|
246
273
|
...input.content.details.map((detail) =>
|
|
247
274
|
notificationText(detail, input.workspaceName),
|
|
248
275
|
),
|
|
276
|
+
...(!includedAllowance ? meters.map(notificationUsageMeterText) : []),
|
|
249
277
|
]),
|
|
278
|
+
...(targetUrl && includedAllowance
|
|
279
|
+
? ['', `${openLabel}: ${targetUrl}`]
|
|
280
|
+
: []),
|
|
250
281
|
'',
|
|
251
282
|
`You are receiving this because of your Deepline notification settings: ${settingsUrl}`,
|
|
252
283
|
...(optOutUrl
|
|
@@ -262,7 +293,7 @@ export function renderProductNotificationEmail(
|
|
|
262
293
|
const detailCount = input.content.details.length;
|
|
263
294
|
const html = [
|
|
264
295
|
'<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="background-color:#ffffff"><tr><td align="center" style="padding:48px 24px">',
|
|
265
|
-
|
|
296
|
+
`<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="max-width:480px"><tr><td style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased${includedAllowance ? ';text-align:left' : ''}">`,
|
|
266
297
|
'<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="margin:0 0 40px"><tr>',
|
|
267
298
|
`<td align="left" valign="middle"><a href="${escapeHtml(logoUrl)}" style="display:inline-block;text-decoration:none"><img src="https://code.deepline.com/brand/logo_full_dark.png" width="120" height="auto" alt="Deepline" style="display:block;border:0"></a></td>`,
|
|
268
299
|
`<td align="right" valign="middle">${severityBadge}</td>`,
|
|
@@ -301,10 +332,17 @@ export function renderProductNotificationEmail(
|
|
|
301
332
|
`<p style="margin:16px 0 32px;font-size:14px;line-height:1.6;color:#525252">Run: <a href="${escapeHtml(targetUrl!)}" style="color:#525252;text-decoration:underline">${escapeHtml(playRun.runId)}</a></p>`,
|
|
302
333
|
]
|
|
303
334
|
: [
|
|
304
|
-
`<h1 style="margin:0 0 8px;font-size:22px;font-weight:600;color:#0a0a0a;line-height:1.3;letter-spacing:-0.02em">${escapeHtml(input.content.title)}</h1>`,
|
|
305
|
-
|
|
335
|
+
`<h1 style="margin:0 0 ${includedAllowance ? '32px' : '8px'};font-size:22px;font-weight:600;color:#0a0a0a;line-height:1.3;letter-spacing:-0.02em">${escapeHtml(input.content.title)}</h1>`,
|
|
336
|
+
...(includedAllowance ? htmlMeters : []),
|
|
337
|
+
`<p style="margin:0 0 ${includedAllowance ? '12px' : '24px'};font-size:15px;line-height:1.6;color:#525252">${contentHtml(input.content.summary, input.workspaceName)}</p>`,
|
|
306
338
|
]),
|
|
307
|
-
...(
|
|
339
|
+
...(includedAllowance
|
|
340
|
+
? input.content.details.map(
|
|
341
|
+
(detail) =>
|
|
342
|
+
`<p style="margin:0 0 12px;font-size:15px;line-height:1.6;color:#525252">${contentHtml(detail, input.workspaceName)}</p>`,
|
|
343
|
+
)
|
|
344
|
+
: []),
|
|
345
|
+
...(!playRun && !includedAllowance && detailCount > 0
|
|
308
346
|
? [
|
|
309
347
|
`<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="border:1px solid #e5e5e5;border-radius:10px;margin:0 0 28px"><tr><td style="padding:${showGroupHeader ? '4px' : '11px'} 18px">`,
|
|
310
348
|
...input.content.details.map((detail, index) =>
|
|
@@ -318,10 +356,11 @@ export function renderProductNotificationEmail(
|
|
|
318
356
|
'</td></tr></table>',
|
|
319
357
|
]
|
|
320
358
|
: []),
|
|
359
|
+
...(!includedAllowance ? htmlMeters : []),
|
|
321
360
|
...(targetUrl && !playRun
|
|
322
361
|
? [
|
|
323
362
|
'<table role="presentation" cellspacing="0" cellpadding="0" style="margin:0 0 32px"><tr>',
|
|
324
|
-
`<td style="background-color:#0a0a0a;border-radius:6px"><a href="${escapeHtml(targetUrl)}" style="display:inline-block;padding:12px 24px;font-size:14px;font-weight:500;color:#ffffff;text-decoration:none"
|
|
363
|
+
`<td style="background-color:#0a0a0a;border-radius:6px"><a href="${escapeHtml(targetUrl)}" style="display:inline-block;padding:12px 24px;font-size:14px;font-weight:500;color:#ffffff;text-decoration:none">${openLabel}</a></td>`,
|
|
325
364
|
'</tr></table>',
|
|
326
365
|
]
|
|
327
366
|
: []),
|
|
@@ -34,6 +34,7 @@ export const ProductNotificationEvent = {
|
|
|
34
34
|
BillingRenewalLate: 'billing.renewal.late',
|
|
35
35
|
BillingUsageChargeObserved: 'billing.usage.charge_observed',
|
|
36
36
|
BillingAllowanceExhausted: 'billing.allowance.exhausted',
|
|
37
|
+
BillingIncludedUsageExhausted: 'billing.included_usage.exhausted',
|
|
37
38
|
MonitorLifecycleChanged: 'monitor.lifecycle.changed',
|
|
38
39
|
PlayLifecycleChanged: 'play.lifecycle.changed',
|
|
39
40
|
PlayRunCompleted: 'play.run.completed',
|
|
@@ -80,6 +81,7 @@ export const PRODUCT_NOTIFICATION_EVENT_NAMES = [
|
|
|
80
81
|
ProductNotificationEvent.BillingRenewalLate,
|
|
81
82
|
ProductNotificationEvent.BillingUsageChargeObserved,
|
|
82
83
|
ProductNotificationEvent.BillingAllowanceExhausted,
|
|
84
|
+
ProductNotificationEvent.BillingIncludedUsageExhausted,
|
|
83
85
|
] as const;
|
|
84
86
|
|
|
85
87
|
export const PRODUCT_NOTIFICATION_COMPATIBILITY_EVENT_NAMES = [
|
|
@@ -298,6 +300,26 @@ export const PRODUCT_NOTIFICATION_EVENT_DEFINITIONS: readonly ProductNotificatio
|
|
|
298
300
|
orderingSubjectFact: 'accountId',
|
|
299
301
|
allowedTriggers: ['each_match'],
|
|
300
302
|
},
|
|
303
|
+
{
|
|
304
|
+
eventName: ProductNotificationEvent.BillingIncludedUsageExhausted,
|
|
305
|
+
producerKey: ProductNotificationProducerKey.BillingUsage,
|
|
306
|
+
requiredFacts: {
|
|
307
|
+
accountId: 'string',
|
|
308
|
+
allowance: 'string',
|
|
309
|
+
used: 'number',
|
|
310
|
+
included: 'number',
|
|
311
|
+
unit: 'string',
|
|
312
|
+
overageRate: 'string',
|
|
313
|
+
resetsAt: 'number',
|
|
314
|
+
targetUrl: 'string',
|
|
315
|
+
},
|
|
316
|
+
optionalFacts: {
|
|
317
|
+
nextPlan: 'string',
|
|
318
|
+
nextIncluded: 'number',
|
|
319
|
+
},
|
|
320
|
+
orderingSubjectFact: 'accountId',
|
|
321
|
+
allowedTriggers: ['each_match'],
|
|
322
|
+
},
|
|
301
323
|
{
|
|
302
324
|
eventName: ProductNotificationEvent.BillingRenewalLate,
|
|
303
325
|
producerKey: ProductNotificationProducerKey.BillingPurchases,
|
|
@@ -36,6 +36,7 @@ export type SlackPayloadEnricher = (
|
|
|
36
36
|
) => SlackPayload | Promise<SlackPayload>;
|
|
37
37
|
|
|
38
38
|
export type SlackDeliveryOptions = {
|
|
39
|
+
allowWebhookFallback?: boolean;
|
|
39
40
|
enrichPayload?: SlackPayloadEnricher;
|
|
40
41
|
postMessage?: (
|
|
41
42
|
token: string,
|
|
@@ -701,7 +702,11 @@ export async function sendSlackEvent(
|
|
|
701
702
|
logSlackEventDispatch(channel, sanitizedNormalized, 'bot');
|
|
702
703
|
return;
|
|
703
704
|
}
|
|
704
|
-
if (
|
|
705
|
+
if (
|
|
706
|
+
isBotOnlySlackChannel(channel) ||
|
|
707
|
+
options.allowWebhookFallback === false
|
|
708
|
+
)
|
|
709
|
+
throw error;
|
|
705
710
|
const webhookUrl = resolveWebhookUrl(channel);
|
|
706
711
|
if (!webhookUrl) throw error;
|
|
707
712
|
await postSlackWebhook(webhookUrl, sanitizedNormalized);
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
reportSetupCompleted,
|
|
15
15
|
resolvePendingAuthClaimForResume,
|
|
16
16
|
statusBannerLine
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-2BRTYIAH.mjs";
|
|
18
|
+
import "./chunk-VFHIYWMC.mjs";
|
|
19
|
+
import "./chunk-4NIGNT7X.mjs";
|
|
20
|
+
import "./chunk-TNQOR6XQ.mjs";
|
|
21
21
|
import "./chunk-4QF2K7TM.mjs";
|
|
22
22
|
import "./chunk-DLIRSHV6.mjs";
|
|
23
23
|
import "./chunk-HBL4PM5Q.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-KKSKYZO4.mjs";
|
|
25
25
|
import "./chunk-WZYKRD7T.mjs";
|
|
26
26
|
import "./chunk-KRD6H754.mjs";
|
|
27
27
|
export {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkMLEUOTEQjs = require('./chunk-MLEUOTEQ.js');
|
|
18
|
+
require('./chunk-2I7VN65H.js');
|
|
19
|
+
require('./chunk-JO2JZUBR.js');
|
|
20
|
+
require('./chunk-NWIDPT7H.js');
|
|
21
|
+
require('./chunk-ALJJRZNJ.js');
|
|
22
|
+
require('./chunk-XNYIZMNQ.js');
|
|
23
|
+
require('./chunk-DIAWYWT5.js');
|
|
24
|
+
require('./chunk-EFO5GVYS.js');
|
|
25
|
+
require('./chunk-OG64RBAC.js');
|
|
26
|
+
require('./chunk-COGTRVWW.js');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkMLEUOTEQjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkMLEUOTEQjs.authStatusLine; exports.clearPendingClaim = _chunkMLEUOTEQjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkMLEUOTEQjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkMLEUOTEQjs.handleRegister; exports.handleStatus = _chunkMLEUOTEQjs.handleStatus; exports.handleWait = _chunkMLEUOTEQjs.handleWait; exports.httpJson = _chunkMLEUOTEQjs.httpJson; exports.readPendingAuthClaim = _chunkMLEUOTEQjs.readPendingAuthClaim; exports.readStatusBanner = _chunkMLEUOTEQjs.readStatusBanner; exports.registerAuthCommands = _chunkMLEUOTEQjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkMLEUOTEQjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkMLEUOTEQjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkMLEUOTEQjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkMLEUOTEQjs.statusBannerLine;
|