{
  "$schema": "./.schemas/page.schema.json",
  "title": "Project",
  "icon": "triangle.fill",
  "sidebar": false,
  "params": {
    "id": {
      "example": "prj_Kx7rWq2HarborWeb9Lm4Tz",
      "pattern": "prj_[A-Za-z0-9]{1,64}"
    }
  },
  "title_from": {
    "ref": "p",
    "value": "project.name"
  },
  "sources": {
    "p": {
      "url": "https://api.vercel.com",
      "secret": "vercel",
      "every": "1m",
      "requests": {
        "project": "/v9/projects/{param.id}",
        "deploys": "/v7/deployments?projectId={param.id}&limit=20",
        "prod": "/v7/deployments?projectId={param.id}&target=production&limit=1",
        "aliases": "/v4/aliases?projectId={param.id}&limit=100",
        "prod_domains": "/v9/projects/{param.id}/domains?production=true&redirects=false&limit=20",
        "candidates": "/v7/deployments?projectId={param.id}&rollbackCandidate=true&limit=20",
        "domains": "/v9/projects/{param.id}/domains?limit=20"
      },
      "derive": [
        {
          "name": "project_id",
          "value": "project.id"
        },
        {
          "name": "project_name",
          "value": "project.name"
        },
        {
          "name": "paused",
          "value": {
            "path": "project.paused",
            "default": false
          }
        },
        {
          "name": "serving_host",
          "value": "project.targets.production.alias[0]"
        },
        {
          "name": "live_alias",
          "value": {
            "first": "alias",
            "of": "aliases.aliases",
            "lookup": {
              "from": "prod_domains.domains",
              "by": "name",
              "on": "alias",
              "as": "dom"
            },
            "where": {
              "all": [
                {
                  "path": "dom.name",
                  "exists": true
                },
                {
                  "path": "dom.redirect",
                  "exists": false
                },
                {
                  "path": "dom.gitBranch",
                  "exists": false
                }
              ]
            }
          }
        },
        {
          "name": "live_host",
          "value": {
            "if": {
              "path": "live_alias",
              "exists": true
            },
            "then": "live_alias",
            "else": "serving_host"
          }
        },
        {
          "name": "aliases_more",
          "value": {
            "if": {
              "path": "aliases.pagination.next",
              "exists": true
            },
            "then": {
              "template": "yes"
            },
            "else": {
              "template": "no"
            }
          }
        },
        {
          "name": "alias_serving_id",
          "value": {
            "first": "deploymentId",
            "of": "aliases.aliases",
            "where": {
              "path": "alias",
              "equals": {
                "answer": "live_host"
              }
            }
          }
        },
        {
          "name": "alias_serving_at",
          "value": {
            "first": "updatedAt",
            "of": "aliases.aliases",
            "where": {
              "path": "alias",
              "equals": {
                "answer": "live_host"
              }
            }
          }
        },
        {
          "name": "target_ready",
          "value": {
            "if": {
              "path": "project.targets.production.readyState",
              "equals": "READY"
            },
            "then": {
              "template": "yes"
            },
            "else": {
              "template": "no"
            }
          }
        },
        {
          "name": "serving_id",
          "value": {
            "if": {
              "path": "target_ready",
              "equals": "yes"
            },
            "then": "project.targets.production.id",
            "else": "alias_serving_id"
          }
        },
        {
          "name": "serving_at",
          "value": {
            "if": {
              "path": "target_ready",
              "equals": "yes"
            },
            "then": {
              "if": {
                "path": "alias_serving_at",
                "exists": true
              },
              "then": "alias_serving_at",
              "else": {
                "if": {
                  "path": "project.targets.production.readyAt",
                  "exists": true
                },
                "then": "project.targets.production.readyAt",
                "else": "project.targets.production.createdAt"
              }
            },
            "else": "alias_serving_at"
          }
        },
        {
          "name": "prod_id",
          "value": "prod.deployments[0].uid"
        },
        {
          "name": "prod_state",
          "value": "prod.deployments[0].state"
        },
        {
          "name": "prod_at",
          "value": "prod.deployments[0].created"
        },
        {
          "name": "prod_started",
          "value": {
            "if": {
              "path": "prod.deployments[0].buildingAt",
              "exists": true
            },
            "then": "prod.deployments[0].buildingAt",
            "else": "prod.deployments[0].created"
          }
        },
        {
          "name": "builds",
          "value": {
            "each": "deploys.deployments",
            "where": {
              "all": [
                {
                  "path": "state",
                  "equals": "READY"
                },
                {
                  "path": "buildingAt",
                  "exists": true
                },
                {
                  "value": {
                    "subtract": [
                      "ready",
                      "buildingAt"
                    ]
                  },
                  "gte": 0
                }
              ]
            },
            "sort": "ready",
            "fields": {
              "at": "ready",
              "s": {
                "divide": [
                  {
                    "subtract": [
                      "ready",
                      "buildingAt"
                    ]
                  },
                  1000
                ],
                "round": 0
              }
            }
          }
        },
        {
          "name": "rows_c",
          "value": {
            "each": "deploys.deployments",
            "limit": 20,
            "lookup": {
              "from": "candidates.deployments",
              "by": "uid",
              "on": "uid",
              "as": "candidate"
            },
            "fields": {
              "is_candidate": {
                "if": {
                  "path": "candidate.uid",
                  "exists": true
                },
                "then": {
                  "template": "yes"
                },
                "else": {
                  "template": "no"
                }
              },
              "uid": "uid",
              "name": "name",
              "projectId": "projectId",
              "state": "state",
              "target": {
                "path": "target",
                "default": "preview"
              },
              "readySubstate": "readySubstate",
              "created": "created",
              "inspectorUrl": "inspectorUrl",
              "buildingAt": {
                "if": {
                  "path": "buildingAt",
                  "exists": true
                },
                "then": "buildingAt",
                "else": "created"
              },
              "ready": "ready",
              "message": {
                "if": {
                  "path": "meta.githubCommitMessage",
                  "exists": true
                },
                "then": "meta.githubCommitMessage",
                "else": {
                  "if": {
                    "path": "meta.gitlabCommitMessage",
                    "exists": true
                  },
                  "then": "meta.gitlabCommitMessage",
                  "else": {
                    "if": {
                      "path": "meta.bitbucketCommitMessage",
                      "exists": true
                    },
                    "then": "meta.bitbucketCommitMessage",
                    "else": {
                      "template": "{name}"
                    }
                  }
                }
              },
              "branch": {
                "if": {
                  "path": "meta.githubCommitRef",
                  "exists": true
                },
                "then": "meta.githubCommitRef",
                "else": {
                  "if": {
                    "path": "meta.gitlabCommitRef",
                    "exists": true
                  },
                  "then": "meta.gitlabCommitRef",
                  "else": {
                    "if": {
                      "path": "meta.bitbucketCommitRef",
                      "exists": true
                    },
                    "then": "meta.bitbucketCommitRef",
                    "else": {
                      "if": {
                        "path": "target",
                        "equals": "production"
                      },
                      "then": {
                        "template": "Production"
                      },
                      "else": {
                        "template": "Preview"
                      }
                    }
                  }
                }
              },
              "target_word": {
                "if": {
                  "path": "target",
                  "equals": "production"
                },
                "then": {
                  "template": "Production"
                },
                "else": {
                  "template": "Preview"
                }
              },
              "state_word": {
                "if": {
                  "all": [
                    {
                      "path": "state",
                      "equals": "READY"
                    },
                    {
                      "path": "readySubstate",
                      "equals": "STAGED"
                    },
                    {
                      "path": "target",
                      "equals": "production"
                    }
                  ]
                },
                "then": {
                  "template": "Staged"
                },
                "else": {
                  "if": {
                    "path": "state",
                    "in": [
                      "READY",
                      "ERROR",
                      "CANCELED",
                      "BUILDING",
                      "INITIALIZING",
                      "QUEUED",
                      "BLOCKED",
                      "DELETED"
                    ]
                  },
                  "then": {
                    "path": "state",
                    "values": {
                      "READY": "Ready",
                      "ERROR": "Failed",
                      "CANCELED": "Cancelled",
                      "BUILDING": "Building",
                      "INITIALIZING": "Building",
                      "QUEUED": "Queued",
                      "BLOCKED": "Blocked",
                      "DELETED": "Deleted"
                    }
                  },
                  "else": {
                    "template": "{state|title}"
                  }
                }
              }
            }
          }
        },
        {
          "name": "serving_created_read",
          "value": {
            "first": "created",
            "of": "deploys.deployments",
            "where": {
              "path": "uid",
              "equals": {
                "answer": "serving_id"
              }
            }
          }
        },
        {
          "name": "serving_created_cand",
          "value": {
            "first": "created",
            "of": "candidates.deployments",
            "where": {
              "path": "uid",
              "equals": {
                "answer": "serving_id"
              }
            }
          }
        },
        {
          "name": "serving_created",
          "value": {
            "if": {
              "path": "serving_id",
              "exists": true
            },
            "then": {
              "if": {
                "path": "serving_created_read",
                "exists": true
              },
              "then": "serving_created_read",
              "else": {
                "if": {
                  "path": "serving_created_cand",
                  "exists": true
                },
                "then": "serving_created_cand",
                "else": {
                  "path": "serving_id_missing",
                  "default": 0
                }
              }
            }
          }
        },
        {
          "name": "newer_waiting",
          "value": {
            "count": "deploys.deployments",
            "default": 0,
            "where": {
              "all": [
                {
                  "path": "target",
                  "equals": "production"
                },
                {
                  "path": "state",
                  "equals": "READY"
                },
                {
                  "path": "created",
                  "gt": {
                    "answer": "serving_created"
                  }
                }
              ]
            }
          }
        },
        {
          "name": "serving_list",
          "value": {
            "each": [
              "candidates.deployments",
              "deploys.deployments"
            ],
            "where": {
              "path": "uid",
              "equals": {
                "answer": "serving_id"
              }
            },
            "limit": 1,
            "fields": {
              "deploymentId": "uid"
            }
          }
        },
        {
          "name": "rows",
          "value": {
            "each": "rows_c",
            "lookup": {
              "from": "serving_list",
              "by": "deploymentId",
              "on": "uid",
              "as": "live"
            },
            "fields": {
              "is_candidate": "is_candidate",
              "uid": "uid",
              "name": "name",
              "projectId": "projectId",
              "state": "state",
              "target": "target",
              "readySubstate": "readySubstate",
              "created": "created",
              "inspectorUrl": "inspectorUrl",
              "buildingAt": "buildingAt",
              "ready": "ready",
              "message": "message",
              "branch": "branch",
              "target_word": "target_word",
              "state_word": "state_word",
              "is_serving": {
                "if": {
                  "path": "live.deploymentId",
                  "exists": true
                },
                "then": {
                  "template": "yes"
                },
                "else": {
                  "template": "no"
                }
              }
            }
          }
        },
        {
          "name": "n_builds",
          "value": {
            "count": "builds",
            "default": 0
          }
        },
        {
          "name": "oldest_read",
          "value": {
            "min": "created",
            "of": "deploys.deployments"
          }
        },
        {
          "name": "day_partial",
          "value": {
            "if": {
              "all": [
                {
                  "path": "deploys.pagination.next",
                  "exists": true
                },
                {
                  "value": {
                    "since": "oldest_read"
                  },
                  "lt": 86400
                }
              ]
            },
            "then": {
              "template": "yes"
            },
            "else": {
              "template": "no"
            }
          }
        },
        {
          "name": "day_count",
          "value": {
            "count": "deploys.deployments",
            "where": {
              "value": {
                "since": "created"
              },
              "lt": 86400
            },
            "default": 0
          }
        },
        {
          "name": "day_failed",
          "value": {
            "count": "deploys.deployments",
            "where": {
              "all": [
                {
                  "value": {
                    "since": "created"
                  },
                  "lt": 86400
                },
                {
                  "path": "state",
                  "equals": "ERROR"
                }
              ]
            },
            "default": 0
          }
        },
        {
          "name": "framework_known",
          "value": {
            "path": "project.framework",
            "values": {
              "nextjs": "Next.js",
              "astro": "Astro",
              "sveltekit": "SvelteKit",
              "sveltekit-1": "SvelteKit",
              "nuxtjs": "Nuxt",
              "remix": "Remix",
              "gatsby": "Gatsby",
              "vite": "Vite",
              "create-react-app": "Create React App",
              "hugo": "Hugo",
              "docusaurus-2": "Docusaurus",
              "docusaurus": "Docusaurus",
              "vue": "Vue",
              "angular": "Angular",
              "eleventy": "Eleventy",
              "hono": "Hono",
              "express": "Express",
              "fastapi": "FastAPI",
              "flask": "Flask",
              "django": "Django",
              "solidstart-1": "SolidStart",
              "react-router": "React Router",
              "storybook": "Storybook",
              "jekyll": "Jekyll",
              "hexo": "Hexo",
              "ember": "Ember"
            },
            "default": "?"
          }
        },
        {
          "name": "framework_name",
          "value": {
            "if": {
              "path": "project.framework",
              "exists": false
            },
            "then": {
              "template": "Other"
            },
            "else": {
              "if": {
                "path": "framework_known",
                "equals": "?"
              },
              "then": {
                "template": "{project.framework|title}"
              },
              "else": "framework_known"
            }
          }
        }
      ]
    }
  },
  "cards": [
    {
      "id": "production",
      "type": "status",
      "width": "full",
      "label": "Production",
      "state": "unknown",
      "actions_placement": "corner",
      "actions": [
        {
          "label": "Redeploy",
          "icon": "arrow.trianglehead.2.clockwise.rotate.90",
          "method": "POST",
          "path": "/v13/deployments",
          "body": {
            "name": "{answer.project_name}",
            "project": "{answer.project_id}",
            "deploymentId": "{answer.serving_id}",
            "target": "production"
          },
          "confirm": {
            "message": "Build {answer.project_name} again from the deployment serving production now?",
            "button": "Redeploy"
          },
          "error": "error.message",
          "when": {
            "all": [
              {
                "path": "serving_id",
                "exists": true
              },
              {
                "path": "paused",
                "not": true
              }
            ]
          }
        }
      ],
      "source": {
        "ref": "p",
        "map": {
          "state": {
            "if": {
              "path": "paused",
              "equals": true
            },
            "then": {
              "template": "off"
            },
            "else": {
              "if": {
                "all": [
                  {
                    "path": "prod_state",
                    "equals": "ERROR"
                  },
                  {
                    "path": "prod_id",
                    "not": {
                      "path": "serving_id"
                    }
                  }
                ]
              },
              "then": {
                "if": {
                  "path": "serving_id",
                  "exists": true
                },
                "then": {
                  "template": "warning"
                },
                "else": {
                  "if": {
                    "path": "aliases_more",
                    "equals": "yes"
                  },
                  "then": {
                    "template": "warning"
                  },
                  "else": {
                    "template": "critical"
                  }
                }
              },
              "else": {
                "if": {
                  "all": [
                    {
                      "path": "prod_state",
                      "equals": "BLOCKED"
                    },
                    {
                      "path": "prod_id",
                      "not": {
                        "path": "serving_id"
                      }
                    }
                  ]
                },
                "then": {
                  "template": "warning"
                },
                "else": {
                  "if": {
                    "path": "serving_id",
                    "exists": true
                  },
                  "then": {
                    "template": "ok"
                  },
                  "else": {
                    "if": {
                      "all": [
                        {
                          "path": "prod_state",
                          "in": [
                            "QUEUED",
                            "INITIALIZING",
                            "BUILDING"
                          ]
                        },
                        {
                          "path": "prod_id",
                          "not": {
                            "path": "serving_id"
                          }
                        }
                      ]
                    },
                    "then": {
                      "template": "ok"
                    },
                    "else": {
                      "template": "off"
                    }
                  }
                }
              }
            }
          },
          "detail": {
            "if": {
              "path": "paused",
              "equals": true
            },
            "then": {
              "template": "Paused"
            },
            "else": {
              "if": {
                "all": [
                  {
                    "path": "prod_state",
                    "equals": "ERROR"
                  },
                  {
                    "path": "prod_id",
                    "not": {
                      "path": "serving_id"
                    }
                  }
                ]
              },
              "then": {
                "if": {
                  "path": "serving_id",
                  "exists": true
                },
                "then": {
                  "template": "Latest build failed {prod_at|ago} · still serving what went live {serving_at|ago}"
                },
                "else": {
                  "if": {
                    "path": "aliases_more",
                    "equals": "yes"
                  },
                  "then": {
                    "template": "Latest build failed {prod_at|ago}"
                  },
                  "else": {
                    "template": "Build failed {prod_at|ago} · nothing serving yet"
                  }
                }
              },
              "else": {
                "if": {
                  "all": [
                    {
                      "path": "prod_state",
                      "in": [
                        "QUEUED",
                        "INITIALIZING",
                        "BUILDING"
                      ]
                    },
                    {
                      "path": "prod_id",
                      "not": {
                        "path": "serving_id"
                      }
                    }
                  ]
                },
                "then": {
                  "template": "Building since {prod_started|ago}"
                },
                "else": {
                  "if": {
                    "all": [
                      {
                        "path": "prod_state",
                        "equals": "BLOCKED"
                      },
                      {
                        "path": "prod_id",
                        "not": {
                          "path": "serving_id"
                        }
                      }
                    ]
                  },
                  "then": {
                    "if": {
                      "path": "serving_id",
                      "exists": true
                    },
                    "then": {
                      "template": "Latest build blocked {prod_at|ago} · still serving what went live {serving_at|ago}"
                    },
                    "else": {
                      "template": "Latest build blocked {prod_at|ago}"
                    }
                  },
                  "else": {
                    "if": {
                      "path": "serving_id",
                      "exists": true
                    },
                    "then": {
                      "if": {
                        "path": "newer_waiting",
                        "gt": 0
                      },
                      "then": {
                        "template": "Serving an earlier build · newer builds wait for Promote"
                      },
                      "else": {
                        "if": {
                          "path": "serving_id",
                          "equals": {
                            "path": "prod_id"
                          }
                        },
                        "then": {
                          "template": "Ready · deployed {prod_at|ago}"
                        },
                        "else": {
                          "template": "Ready · went live {serving_at|ago}"
                        }
                      }
                    },
                    "else": {
                      "template": "No production deployment yet"
                    }
                  }
                }
              }
            }
          },
          "url": {
            "if": {
              "path": "live_host",
              "exists": true
            },
            "then": {
              "template": "https://{live_host}"
            }
          }
        }
      }
    },
    {
      "id": "build-time",
      "type": "sparkline",
      "label": "Build time",
      "unit": "s",
      "change": false,
      "points": [],
      "source": {
        "ref": "p",
        "when": {
          "path": "n_builds",
          "gte": 2
        },
        "map": {
          "points": {
            "each": "builds",
            "value": "s"
          },
          "times": {
            "each": "builds",
            "value": "at"
          }
        }
      }
    },
    {
      "id": "about",
      "type": "facts",
      "label": "Project",
      "items": [
        {
          "key": "Last 24 hours",
          "value": "—"
        },
        {
          "key": "Production branch",
          "value": "—"
        },
        {
          "key": "Framework",
          "value": "—"
        }
      ],
      "source": {
        "ref": "p",
        "map": {
          "items[0].value": {
            "if": {
              "path": "day_partial",
              "equals": "yes"
            },
            "then": {
              "if": {
                "path": "day_failed",
                "gt": 0
              },
              "then": {
                "template": "At least {day_count} deployments · {day_failed} failed"
              },
              "else": {
                "template": "At least {day_count} deployments"
              }
            },
            "else": {
              "if": {
                "path": "day_failed",
                "gt": 0
              },
              "then": {
                "template": "{day_count} deployments · {day_failed} failed"
              },
              "else": {
                "if": {
                  "path": "day_count",
                  "equals": 1
                },
                "then": {
                  "template": "1 deployment"
                },
                "else": {
                  "template": "{day_count} deployments"
                }
              }
            }
          },
          "items[1].value": {
            "if": {
              "path": "project.link.productionBranch",
              "exists": true
            },
            "then": {
              "template": "{project.link.productionBranch|clip:60}"
            },
            "else": {
              "template": "No Git repository"
            }
          },
          "items[2].value": {
            "if": {
              "path": "project.nodeVersion",
              "exists": true
            },
            "then": {
              "template": "{framework_name} · Node {project.nodeVersion}"
            },
            "else": {
              "template": "{framework_name}"
            }
          }
        }
      }
    },
    {
      "id": "domains",
      "type": "list",
      "label": "Domains",
      "max_items": 4,
      "items": [],
      "source": {
        "ref": "p",
        "empty": {
          "text": "No domains yet.",
          "when": {
            "value": {
              "count": "domains.domains",
              "default": 0
            },
            "equals": 0
          }
        },
        "map": {
          "label": {
            "if": {
              "path": "domains.pagination.next",
              "exists": true
            },
            "then": {
              "template": "Domains · first 20"
            },
            "else": {
              "template": "Domains"
            }
          },
          "items": {
            "each": "domains.domains",
            "fields": {
              "key": "name",
              "text": {
                "template": "{name|clip:160}"
              },
              "icon": {
                "if": {
                  "path": "verified",
                  "equals": false
                },
                "then": {
                  "template": "exclamationmark.triangle.fill"
                },
                "else": {
                  "template": "globe"
                }
              },
              "color": {
                "if": {
                  "path": "verified",
                  "equals": false
                },
                "then": {
                  "template": "orange"
                }
              },
              "detail": {
                "if": {
                  "path": "verified",
                  "equals": false
                },
                "then": {
                  "template": "Not verified"
                },
                "else": {
                  "if": {
                    "path": "redirect",
                    "exists": true
                  },
                  "then": {
                    "template": "Redirects to {redirect|clip:27}"
                  },
                  "else": {
                    "if": {
                      "path": "gitBranch",
                      "exists": true
                    },
                    "then": {
                      "template": "Branch {gitBranch|clip:33}"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "id": "deployments",
      "type": "list",
      "label": "Deployments",
      "max_items": 7,
      "items": [],
      "source": {
        "ref": "p",
        "empty": {
          "text": "No deployments yet.",
          "when": {
            "value": {
              "count": "deploys.deployments",
              "default": 0
            },
            "equals": 0
          }
        },
        "map": {
          "label": {
            "if": {
              "path": "deploys.pagination.next",
              "exists": true
            },
            "then": {
              "template": "Deployments · newest 20"
            },
            "else": {
              "template": "Deployments"
            }
          },
          "items": {
            "each": "rows",
            "fields": {
              "key": "uid",
              "text": {
                "template": "{message|plain|clip:80}"
              },
              "subtitle": {
                "if": {
                  "path": "is_serving",
                  "equals": "yes"
                },
                "then": {
                  "template": "{branch|clip:40} · Production · Serving"
                },
                "else": {
                  "template": "{branch|clip:40} · {target_word} · {state_word}"
                }
              },
              "detail": {
                "if": {
                  "path": "state",
                  "in": [
                    "QUEUED",
                    "INITIALIZING",
                    "BUILDING"
                  ]
                },
                "then": {
                  "template": "{buildingAt|ago}"
                },
                "else": {
                  "template": "{created|ago}"
                }
              },
              "icon": {
                "path": "state",
                "values": {
                  "READY": "checkmark.circle",
                  "ERROR": "xmark.octagon.fill",
                  "CANCELED": "xmark.circle",
                  "BUILDING": "hammer",
                  "INITIALIZING": "hammer",
                  "QUEUED": "clock",
                  "BLOCKED": "hand.raised"
                },
                "default": "questionmark.circle"
              },
              "color": {
                "path": "state",
                "values": {
                  "ERROR": "red",
                  "BLOCKED": "orange"
                }
              },
              "url": "inspectorUrl"
            }
          }
        }
      },
      "row_actions": [
        {
          "label": "Promote to production",
          "icon": "arrow.up.circle",
          "method": "POST",
          "path": "/v10/projects/{projectId}/promote/{uid}",
          "confirm": {
            "message": "Send production traffic to this build of {name}?",
            "button": "Promote"
          },
          "error": "error.message",
          "when": {
            "all": [
              {
                "path": "target",
                "equals": "production"
              },
              {
                "path": "state",
                "equals": "READY"
              },
              {
                "path": "is_serving",
                "equals": "no"
              },
              {
                "any": [
                  {
                    "path": "readySubstate",
                    "equals": "STAGED"
                  },
                  {
                    "path": "created",
                    "gt": {
                      "answer": "serving_created"
                    }
                  }
                ]
              }
            ]
          }
        },
        {
          "label": "Roll back to this",
          "icon": "arrow.uturn.backward",
          "method": "POST",
          "path": "/v1/projects/{projectId}/rollback/{uid}",
          "confirm": {
            "message": "Serve this older build of {name} in production? New builds then wait until you promote one.",
            "button": "Roll back"
          },
          "error": "error.message",
          "when": {
            "all": [
              {
                "path": "target",
                "equals": "production"
              },
              {
                "path": "state",
                "equals": "READY"
              },
              {
                "path": "is_candidate",
                "equals": "yes"
              },
              {
                "path": "is_serving",
                "equals": "no"
              },
              {
                "path": "created",
                "lt": {
                  "answer": "serving_created"
                }
              }
            ]
          }
        },
        {
          "label": "Cancel build",
          "icon": "stop.fill",
          "method": "PATCH",
          "path": "/v12/deployments/{uid}/cancel",
          "confirm": {
            "message": "Cancel the build of {name}?",
            "button": "Cancel build"
          },
          "error": "error.message",
          "when": {
            "path": "state",
            "in": [
              "QUEUED",
              "INITIALIZING",
              "BUILDING"
            ]
          }
        }
      ]
    }
  ]
}
