@prisma/cli 3.0.0-dev.99.1 → 8.0.0-rc.10-dev.80

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.
Files changed (86) hide show
  1. package/README.md +26 -28
  2. package/dist/cli.js +14551 -16
  3. package/dist/payload-B88Qvzxk-CrtTXSOe.js +34 -0
  4. package/dist/sender.js +192 -0
  5. package/package.json +26 -19
  6. package/dist/adapters/git.js +0 -54
  7. package/dist/adapters/local-state.js +0 -144
  8. package/dist/adapters/mock-api.js +0 -136
  9. package/dist/adapters/token-storage.js +0 -418
  10. package/dist/cli2.js +0 -119
  11. package/dist/commands/app/index.js +0 -345
  12. package/dist/commands/auth/index.js +0 -96
  13. package/dist/commands/branch/index.js +0 -27
  14. package/dist/commands/database/index.js +0 -159
  15. package/dist/commands/env.js +0 -99
  16. package/dist/commands/git/index.js +0 -36
  17. package/dist/commands/project/index.js +0 -69
  18. package/dist/commands/version/index.js +0 -18
  19. package/dist/controllers/app-env-api.js +0 -54
  20. package/dist/controllers/app-env-file.js +0 -181
  21. package/dist/controllers/app-env.js +0 -502
  22. package/dist/controllers/app.js +0 -2443
  23. package/dist/controllers/auth.js +0 -316
  24. package/dist/controllers/branch.js +0 -103
  25. package/dist/controllers/database.js +0 -318
  26. package/dist/controllers/project.js +0 -731
  27. package/dist/controllers/select-prompt-port.js +0 -12
  28. package/dist/controllers/version.js +0 -12
  29. package/dist/lib/app/app-interaction.js +0 -5
  30. package/dist/lib/app/app-provider.js +0 -544
  31. package/dist/lib/app/branch-database-api.js +0 -102
  32. package/dist/lib/app/branch-database-deploy.js +0 -325
  33. package/dist/lib/app/branch-database.js +0 -215
  34. package/dist/lib/app/build-settings.js +0 -93
  35. package/dist/lib/app/build.js +0 -80
  36. package/dist/lib/app/bun-project.js +0 -45
  37. package/dist/lib/app/compute-config.js +0 -147
  38. package/dist/lib/app/deploy-output.js +0 -24
  39. package/dist/lib/app/deploy-plan.js +0 -58
  40. package/dist/lib/app/deploy-progress.js +0 -100
  41. package/dist/lib/app/domain-guidance.js +0 -14
  42. package/dist/lib/app/env-config.js +0 -67
  43. package/dist/lib/app/env-file.js +0 -82
  44. package/dist/lib/app/env-vars.js +0 -50
  45. package/dist/lib/app/local-dev.js +0 -109
  46. package/dist/lib/app/production-deploy-gate.js +0 -161
  47. package/dist/lib/app/read-branch.js +0 -30
  48. package/dist/lib/auth/auth-ops.js +0 -158
  49. package/dist/lib/auth/client.js +0 -22
  50. package/dist/lib/auth/guard.js +0 -38
  51. package/dist/lib/auth/login.js +0 -330
  52. package/dist/lib/database/provider.js +0 -167
  53. package/dist/lib/diagnostics.js +0 -15
  54. package/dist/lib/fs/home-path.js +0 -24
  55. package/dist/lib/git/local-branch.js +0 -53
  56. package/dist/lib/git/local-status.js +0 -57
  57. package/dist/lib/project/interactive-setup.js +0 -56
  58. package/dist/lib/project/local-pin.js +0 -200
  59. package/dist/lib/project/resolution.js +0 -386
  60. package/dist/lib/project/setup.js +0 -135
  61. package/dist/lib/version.js +0 -55
  62. package/dist/output/patterns.js +0 -90
  63. package/dist/presenters/app-env.js +0 -265
  64. package/dist/presenters/app.js +0 -646
  65. package/dist/presenters/auth.js +0 -183
  66. package/dist/presenters/branch.js +0 -46
  67. package/dist/presenters/database.js +0 -274
  68. package/dist/presenters/project.js +0 -174
  69. package/dist/presenters/verbose-context.js +0 -64
  70. package/dist/presenters/version.js +0 -29
  71. package/dist/shell/command-arguments.js +0 -6
  72. package/dist/shell/command-meta.js +0 -622
  73. package/dist/shell/command-runner.js +0 -112
  74. package/dist/shell/diagnostics-output.js +0 -57
  75. package/dist/shell/errors.js +0 -134
  76. package/dist/shell/global-flags.js +0 -37
  77. package/dist/shell/help.js +0 -89
  78. package/dist/shell/output.js +0 -82
  79. package/dist/shell/prompt.js +0 -41
  80. package/dist/shell/runtime.js +0 -55
  81. package/dist/shell/ui.js +0 -116
  82. package/dist/shell/update-check.js +0 -247
  83. package/dist/use-cases/auth.js +0 -145
  84. package/dist/use-cases/branch.js +0 -47
  85. package/dist/use-cases/create-cli-gateways.js +0 -68
  86. package/dist/use-cases/project.js +0 -30
@@ -1,646 +0,0 @@
1
- import { renderVerboseBlock } from "../shell/ui.js";
2
- import { renderDeployOutputRows } from "../lib/app/deploy-output.js";
3
- import { formatDomainFailureFix } from "../lib/app/domain-guidance.js";
4
- import { renderList, renderShow, serializeList } from "../output/patterns.js";
5
- import { renderResolvedProjectContextBlock, stripVerboseContext } from "./verbose-context.js";
6
- //#region src/presenters/app.ts
7
- function renderAppBuild(context, descriptor, result) {
8
- return renderShow({
9
- title: "Building the local app artifact.",
10
- descriptor,
11
- fields: [
12
- {
13
- key: "build type",
14
- value: result.buildType
15
- },
16
- {
17
- key: "entrypoint",
18
- value: result.entrypoint ?? "none",
19
- tone: result.entrypoint ? "default" : "dim"
20
- },
21
- {
22
- key: "directory",
23
- value: result.directory
24
- }
25
- ]
26
- }, context.ui);
27
- }
28
- function serializeAppBuild(result) {
29
- return result;
30
- }
31
- function renderAppDeploy(context, descriptor, result, options) {
32
- const logsCommand = options?.logsTarget ? `prisma-cli app logs ${options.logsTarget}` : "prisma-cli app logs";
33
- return [
34
- `Live in ${formatDuration(result.durationMs)}`,
35
- ...result.deployment.url ? [context.ui.link(result.deployment.url)] : [],
36
- ...renderBranchDatabaseDeploySummary(context, result),
37
- "",
38
- ...renderDeployOutputRows(context.ui, [{
39
- label: "Logs",
40
- value: logsCommand
41
- }]),
42
- ...renderDeployResolvedContextBlock(context, result),
43
- ...renderDeploySettingsBlock(context, result)
44
- ];
45
- }
46
- function isAppDeployAllResult(result) {
47
- return "deployments" in result;
48
- }
49
- function renderAppDeployAll(context, descriptor, result) {
50
- const lines = [];
51
- for (const deployment of result.deployments) {
52
- lines.push(deployment.target);
53
- lines.push(...renderAppDeploy(context, descriptor, deployment.result, { logsTarget: deployment.target }).map((line) => line ? ` ${line}` : line));
54
- lines.push("");
55
- }
56
- lines.push(...renderDeployOutputRows(context.ui, result.deployments.map((deployment) => ({
57
- label: deployment.target,
58
- value: deployment.result.deployment.url ?? deployment.result.deployment.id
59
- }))));
60
- return lines;
61
- }
62
- function serializeAppDeployAll(result) {
63
- return {
64
- count: result.deployments.length,
65
- deployments: result.deployments.map((deployment) => ({
66
- target: deployment.target,
67
- ...serializeAppDeploy(deployment.result)
68
- }))
69
- };
70
- }
71
- function serializeAppDeploy(result) {
72
- const { deploySettings, localPin: _localPin, ...serialized } = result;
73
- const { id: _branchId, ...branch } = serialized.branch;
74
- return {
75
- ...serialized,
76
- branch,
77
- deploySettings: {
78
- config: deploySettings.config,
79
- buildCommand: deploySettings.buildCommand,
80
- outputDirectory: deploySettings.outputDirectory
81
- }
82
- };
83
- }
84
- function renderBranchDatabaseDeploySummary(context, result) {
85
- if (!result.branchDatabase || result.branchDatabase.status !== "created") return [];
86
- return ["", ...renderDeployOutputRows(context.ui, [{
87
- label: "Database",
88
- value: result.branchDatabase.database?.name ?? "created"
89
- }, {
90
- label: "Env",
91
- value: result.branchDatabase.envVars.join(", ")
92
- }])];
93
- }
94
- function formatDuration(durationMs) {
95
- if (durationMs < 1e3) return `${durationMs}ms`;
96
- return `${(durationMs / 1e3).toFixed(1)}s`;
97
- }
98
- function renderDeployResolvedContextBlock(context, result) {
99
- return renderResolvedProjectContextBlock(context.ui, {
100
- workspace: result.workspace,
101
- project: result.project,
102
- resolution: result.resolution,
103
- branch: {
104
- id: result.branch.id,
105
- name: result.branch.name,
106
- kind: result.branch.kind
107
- }
108
- }, { extraRows: [
109
- {
110
- key: "app",
111
- value: result.app.name
112
- },
113
- {
114
- key: "app id",
115
- value: result.app.id,
116
- tone: "dim"
117
- },
118
- {
119
- key: "deployment id",
120
- value: result.deployment.id,
121
- tone: "dim"
122
- },
123
- {
124
- key: "deployment status",
125
- value: result.deployment.status
126
- },
127
- ...result.localPin ? [{
128
- key: "local pin",
129
- value: result.localPin.path
130
- }] : [],
131
- {
132
- key: "deploy duration",
133
- value: formatDuration(result.durationMs)
134
- }
135
- ] });
136
- }
137
- function renderDeploySettingsBlock(context, result) {
138
- return renderVerboseBlock(context.ui, [...deploySettingsRows(result.deploySettings), ...branchDatabaseRows(result.branchDatabase)], { title: "Deploy settings" });
139
- }
140
- function deploySettingsRows(settings) {
141
- return [
142
- {
143
- key: "framework",
144
- value: `${settings.framework.name} (${settings.framework.buildType})`
145
- },
146
- {
147
- key: "framework source",
148
- value: settings.framework.source,
149
- tone: "dim"
150
- },
151
- {
152
- key: "entrypoint",
153
- value: settings.entrypoint ?? "derived from build output",
154
- tone: settings.entrypoint ? "default" : "dim"
155
- },
156
- {
157
- key: "http port",
158
- value: String(settings.httpPort)
159
- },
160
- {
161
- key: "region",
162
- value: settings.region ?? "existing app region",
163
- tone: settings.region ? "default" : "dim"
164
- },
165
- {
166
- key: "env vars",
167
- value: formatEnvVarNames(settings.envVars),
168
- tone: settings.envVars.length > 0 ? "default" : "dim"
169
- }
170
- ];
171
- }
172
- function branchDatabaseRows(branchDatabase) {
173
- if (!branchDatabase) return [{
174
- key: "branch db",
175
- value: "not configured",
176
- tone: "dim"
177
- }];
178
- return [{
179
- key: "branch db",
180
- value: branchDatabase.status === "created" ? `created${branchDatabase.database ? ` (${branchDatabase.database.name})` : ""}` : `skipped${branchDatabase.reason ? ` (${branchDatabase.reason})` : ""}`,
181
- tone: branchDatabase.status === "created" ? "success" : "dim"
182
- }, ...branchDatabase.envVars.length > 0 ? [{
183
- key: "branch db env",
184
- value: branchDatabase.envVars.join(", ")
185
- }] : []];
186
- }
187
- function formatEnvVarNames(envVars) {
188
- return envVars.length > 0 ? envVars.join(", ") : "none";
189
- }
190
- function renderAppListDeploys(context, descriptor, result) {
191
- const lines = renderList({
192
- title: "Listing deployments for the selected app.",
193
- descriptor,
194
- parentContext: {
195
- key: "app",
196
- value: result.app?.name ?? "not selected"
197
- },
198
- items: result.deployments.map((deployment) => ({
199
- noun: "deployment",
200
- label: deployment.id,
201
- id: deployment.id,
202
- status: deployment.live ? "active" : null
203
- })),
204
- emptyMessage: result.app ? "No deployments found." : "No apps found."
205
- }, context.ui);
206
- lines.push(...renderResolvedProjectContextBlock(context.ui, result.verboseContext));
207
- return lines;
208
- }
209
- function serializeAppListDeploys(result) {
210
- const { verboseContext: _verboseContext, ...serializable } = result;
211
- if (!serializable.app) return {
212
- projectId: serializable.projectId,
213
- app: null,
214
- items: [],
215
- count: 0
216
- };
217
- return {
218
- projectId: serializable.projectId,
219
- app: serializable.app,
220
- ...serializeList({
221
- context: { app: serializable.app.name },
222
- items: serializable.deployments.map((deployment) => ({
223
- noun: "deployment",
224
- label: deployment.id,
225
- id: deployment.id,
226
- status: deployment.live ? "active" : null
227
- }))
228
- })
229
- };
230
- }
231
- function renderAppShow(context, descriptor, result) {
232
- const lines = renderShow({
233
- title: "Showing the selected app state.",
234
- descriptor,
235
- fields: [
236
- {
237
- key: "project",
238
- value: result.projectId
239
- },
240
- {
241
- key: "app",
242
- value: result.app?.name ?? "not selected",
243
- tone: result.app ? "default" : "dim"
244
- },
245
- {
246
- key: "live deployment",
247
- value: result.liveDeployment?.id ?? "none",
248
- tone: result.liveDeployment ? toneForStatus(result.liveDeployment.status) : "dim"
249
- },
250
- {
251
- key: "live url",
252
- value: result.liveUrl ?? "unavailable",
253
- tone: result.liveUrl ? "link" : "dim"
254
- },
255
- {
256
- key: "recent deployments",
257
- value: formatRecentDeployments(result.recentDeployments),
258
- tone: result.recentDeployments.length > 0 ? "default" : "dim"
259
- }
260
- ]
261
- }, context.ui);
262
- lines.push(...renderResolvedProjectContextBlock(context.ui, result.verboseContext));
263
- return lines;
264
- }
265
- function serializeAppShow(result) {
266
- return stripVerboseContext(result);
267
- }
268
- function renderAppShowDeploy(context, descriptor, result) {
269
- return renderShow({
270
- title: "Showing deployment details.",
271
- descriptor,
272
- fields: [
273
- ...result.app ? [{
274
- key: "app",
275
- value: result.app.name
276
- }] : [],
277
- {
278
- key: "deployment",
279
- value: result.deployment.id
280
- },
281
- {
282
- key: "status",
283
- value: result.deployment.status,
284
- tone: toneForStatus(result.deployment.status)
285
- },
286
- ...result.deployment.url ? [{
287
- key: "url",
288
- value: result.deployment.url,
289
- tone: "link"
290
- }] : [],
291
- ...result.deployment.live === null ? [] : [{
292
- key: "live",
293
- value: result.deployment.live ? "yes" : "no",
294
- tone: result.deployment.live ? "success" : "dim"
295
- }],
296
- {
297
- key: "created",
298
- value: result.deployment.createdAt,
299
- tone: "dim"
300
- }
301
- ]
302
- }, context.ui);
303
- }
304
- function serializeAppShowDeploy(result) {
305
- return result;
306
- }
307
- function renderAppOpen(context, descriptor, result) {
308
- const lines = renderShow({
309
- title: result.opened ? "Opening the live URL for the selected app." : "Resolving the live URL for the selected app.",
310
- descriptor,
311
- fields: [
312
- {
313
- key: "project",
314
- value: result.projectId
315
- },
316
- {
317
- key: "app",
318
- value: result.app.name
319
- },
320
- {
321
- key: "url",
322
- value: result.url,
323
- tone: "link"
324
- },
325
- {
326
- key: "opened",
327
- value: result.opened ? "yes" : "no",
328
- tone: result.opened ? "success" : "dim"
329
- }
330
- ]
331
- }, context.ui);
332
- lines.push(...renderResolvedProjectContextBlock(context.ui, result.verboseContext));
333
- return lines;
334
- }
335
- function serializeAppOpen(result) {
336
- return stripVerboseContext(result);
337
- }
338
- function renderAppDomainAdd(context, descriptor, result) {
339
- return renderShow({
340
- title: result.existing ? "Showing the existing custom domain for the selected app." : "Adding a custom domain to the selected app.",
341
- descriptor,
342
- fields: [
343
- ...domainTargetFields(result),
344
- {
345
- key: "hostname",
346
- value: result.domain.hostname
347
- },
348
- {
349
- key: "status",
350
- value: result.domain.status,
351
- tone: toneForDomainStatus(result.domain.status)
352
- },
353
- ...domainDnsFields(result.domain)
354
- ]
355
- }, context.ui);
356
- }
357
- function serializeAppDomainAdd(result) {
358
- return result;
359
- }
360
- function renderAppDomainShow(context, descriptor, result) {
361
- return renderShow({
362
- title: "Showing custom domain status.",
363
- descriptor,
364
- fields: [
365
- ...domainTargetFields(result),
366
- {
367
- key: "hostname",
368
- value: result.domain.hostname
369
- },
370
- {
371
- key: "status",
372
- value: result.domain.status,
373
- tone: toneForDomainStatus(result.domain.status)
374
- },
375
- ...domainFailureFields(result.domain),
376
- {
377
- key: "cert expires",
378
- value: formatOptionalUtcDate(result.domain.certExpiresAt),
379
- tone: result.domain.certExpiresAt ? "default" : "dim"
380
- },
381
- {
382
- key: "created",
383
- value: formatUtcDate(result.domain.createdAt),
384
- tone: "dim"
385
- },
386
- ...domainDnsFields(result.domain)
387
- ]
388
- }, context.ui);
389
- }
390
- function serializeAppDomainShow(result) {
391
- return result;
392
- }
393
- function renderAppDomainRemove(context, descriptor, result) {
394
- return renderShow({
395
- title: "Removing a custom domain from the selected app.",
396
- descriptor,
397
- fields: [
398
- ...domainTargetFields(result),
399
- {
400
- key: "hostname",
401
- value: result.hostname
402
- },
403
- {
404
- key: "removed",
405
- value: result.removed ? "yes" : "no",
406
- tone: result.removed ? "success" : "dim"
407
- }
408
- ]
409
- }, context.ui);
410
- }
411
- function serializeAppDomainRemove(result) {
412
- return result;
413
- }
414
- function renderAppDomainRetry(context, descriptor, result) {
415
- return renderShow({
416
- title: "Retrying custom domain verification.",
417
- descriptor,
418
- fields: [
419
- ...domainTargetFields(result),
420
- {
421
- key: "hostname",
422
- value: result.domain.hostname
423
- },
424
- {
425
- key: "status",
426
- value: result.domain.status,
427
- tone: toneForDomainStatus(result.domain.status)
428
- },
429
- ...domainFailureFields(result.domain),
430
- ...domainDnsFields(result.domain)
431
- ]
432
- }, context.ui);
433
- }
434
- function serializeAppDomainRetry(result) {
435
- return result;
436
- }
437
- function renderAppPromote(context, descriptor, result) {
438
- const lines = renderShow({
439
- title: "Switching the live deployment for the selected app.",
440
- descriptor,
441
- fields: [
442
- {
443
- key: "project",
444
- value: result.projectId
445
- },
446
- {
447
- key: "app",
448
- value: result.app.name
449
- },
450
- {
451
- key: "deployment",
452
- value: result.deployment.id
453
- },
454
- {
455
- key: "status",
456
- value: result.deployment.status,
457
- tone: toneForStatus(result.deployment.status)
458
- },
459
- ...result.deployment.url ? [{
460
- key: "url",
461
- value: result.deployment.url,
462
- tone: "link"
463
- }] : [],
464
- {
465
- key: "live",
466
- value: result.deployment.live ? "yes" : "no",
467
- tone: result.deployment.live ? "success" : "dim"
468
- },
469
- {
470
- key: "created",
471
- value: result.deployment.createdAt,
472
- tone: "dim"
473
- }
474
- ]
475
- }, context.ui);
476
- lines.push(...renderResolvedProjectContextBlock(context.ui, result.verboseContext));
477
- return lines;
478
- }
479
- function serializeAppPromote(result) {
480
- return stripVerboseContext(result);
481
- }
482
- function renderAppRollback(context, descriptor, result) {
483
- const lines = renderShow({
484
- title: "Restoring the selected app to an earlier deployment.",
485
- descriptor,
486
- fields: [
487
- {
488
- key: "project",
489
- value: result.projectId
490
- },
491
- {
492
- key: "app",
493
- value: result.app.name
494
- },
495
- {
496
- key: "deployment",
497
- value: result.deployment.id
498
- },
499
- {
500
- key: "status",
501
- value: result.deployment.status,
502
- tone: toneForStatus(result.deployment.status)
503
- },
504
- ...result.deployment.url ? [{
505
- key: "url",
506
- value: result.deployment.url,
507
- tone: "link"
508
- }] : [],
509
- {
510
- key: "live",
511
- value: result.deployment.live ? "yes" : "no",
512
- tone: result.deployment.live ? "success" : "dim"
513
- },
514
- {
515
- key: "created",
516
- value: result.deployment.createdAt,
517
- tone: "dim"
518
- },
519
- ...result.previousLiveDeploymentId ? [{
520
- key: "replaced",
521
- value: result.previousLiveDeploymentId,
522
- tone: "dim"
523
- }] : []
524
- ]
525
- }, context.ui);
526
- lines.push(...renderResolvedProjectContextBlock(context.ui, result.verboseContext));
527
- return lines;
528
- }
529
- function serializeAppRollback(result) {
530
- return stripVerboseContext(result);
531
- }
532
- function renderAppRun(_context, _descriptor, _result) {
533
- return [];
534
- }
535
- function serializeAppRun(result) {
536
- return result;
537
- }
538
- function renderAppRemove(context, descriptor, result) {
539
- const lines = renderShow({
540
- title: "Removing the selected app.",
541
- descriptor,
542
- fields: [
543
- {
544
- key: "project",
545
- value: result.projectId
546
- },
547
- {
548
- key: "app",
549
- value: result.app.name
550
- },
551
- {
552
- key: "removed",
553
- value: result.removed ? "yes" : "no",
554
- tone: result.removed ? "success" : "dim"
555
- }
556
- ]
557
- }, context.ui);
558
- lines.push(...renderResolvedProjectContextBlock(context.ui, result.verboseContext));
559
- return lines;
560
- }
561
- function serializeAppRemove(result) {
562
- return stripVerboseContext(result);
563
- }
564
- function toneForStatus(status) {
565
- if (status === "running" || status === "ready" || status === "healthy") return "success";
566
- if (status === "provisioning" || status === "building" || status === "starting") return "warning";
567
- if (status === "failed" || status === "error") return "error";
568
- return "default";
569
- }
570
- function toneForDomainStatus(status) {
571
- if (status === "active") return "success";
572
- if (status === "failed") return "error";
573
- if (status === "pending_dns" || status === "verifying" || status === "provisioning_tls" || status === "verified_routing_blocked") return "warning";
574
- return "default";
575
- }
576
- function domainTargetFields(result) {
577
- return [
578
- {
579
- key: "workspace",
580
- value: result.workspace.name
581
- },
582
- {
583
- key: "project",
584
- value: result.project.name
585
- },
586
- {
587
- key: "branch",
588
- value: result.branch.name
589
- },
590
- {
591
- key: "app",
592
- value: result.app.name
593
- }
594
- ];
595
- }
596
- function domainDnsFields(domain) {
597
- const records = domain.dnsRecords;
598
- if (records.length === 0) return [{
599
- key: "dns record",
600
- value: "not provided by platform",
601
- tone: "dim"
602
- }];
603
- return [{
604
- key: "dns record",
605
- value: records.map((record) => {
606
- const ttl = record.ttl ? ` ttl ${record.ttl}` : "";
607
- return `${record.type} ${record.name} -> ${record.value}${ttl}`;
608
- }).join(", ")
609
- }];
610
- }
611
- function formatDomainFailure(domain) {
612
- if (!domain.failureReason) return domain.failureCategory ?? "none";
613
- return domain.failureCategory ? `${domain.failureCategory} - ${domain.failureReason}` : domain.failureReason;
614
- }
615
- function domainFailureFields(domain) {
616
- const tone = hasDomainFailure(domain) ? "error" : "dim";
617
- return [{
618
- key: "failure",
619
- value: formatDomainFailure(domain),
620
- tone
621
- }, ...domainFixFields(domain)];
622
- }
623
- function hasDomainFailure(domain) {
624
- return Boolean(domain.failureCategory || domain.failureReason);
625
- }
626
- function domainFixFields(domain) {
627
- const fix = formatDomainFailureFix(domain);
628
- return fix ? [{
629
- key: "fix",
630
- value: fix
631
- }] : [];
632
- }
633
- function formatOptionalUtcDate(value) {
634
- return value ? formatUtcDate(value) : "-";
635
- }
636
- function formatUtcDate(value) {
637
- const date = new Date(value);
638
- if (Number.isNaN(date.getTime())) return value;
639
- return `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, "0")}-${String(date.getUTCDate()).padStart(2, "0")} ${String(date.getUTCHours()).padStart(2, "0")}:${String(date.getUTCMinutes()).padStart(2, "0")} UTC`;
640
- }
641
- function formatRecentDeployments(deployments) {
642
- if (deployments.length === 0) return "none";
643
- return deployments.map((deployment) => `${deployment.id}${deployment.live ? " (live)" : ""}`).join(", ");
644
- }
645
- //#endregion
646
- export { isAppDeployAllResult, renderAppBuild, renderAppDeploy, renderAppDeployAll, renderAppDomainAdd, renderAppDomainRemove, renderAppDomainRetry, renderAppDomainShow, renderAppListDeploys, renderAppOpen, renderAppPromote, renderAppRemove, renderAppRollback, renderAppRun, renderAppShow, renderAppShowDeploy, serializeAppBuild, serializeAppDeploy, serializeAppDeployAll, serializeAppDomainAdd, serializeAppDomainRemove, serializeAppDomainRetry, serializeAppDomainShow, serializeAppListDeploys, serializeAppOpen, serializeAppPromote, serializeAppRemove, serializeAppRollback, serializeAppRun, serializeAppShow, serializeAppShowDeploy };