github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/buildplan/raw/raw.go (about) 1 package raw 2 3 import ( 4 "github.com/ActiveState/cli/pkg/platform/api/buildplanner/types" 5 "github.com/go-openapi/strfmt" 6 ) 7 8 const ( 9 // ProjectCommitResponse statuses 10 Planning = "PLANNING" 11 Planned = "PLANNED" 12 Started = "STARTED" 13 Completed = "COMPLETED" 14 ) 15 16 type StepInputTag string 17 18 const ( 19 // Tag types 20 TagSource StepInputTag = "src" 21 TagDependency StepInputTag = "deps" 22 ) 23 24 const PlatformTerminalPrefix = "platform:" 25 26 type Build struct { 27 Type string `json:"__typename"` 28 BuildPlanID strfmt.UUID `json:"buildPlanID"` 29 Status string `json:"status"` 30 Terminals []*NamedTarget `json:"terminals"` 31 Artifacts []*Artifact `json:"artifacts"` 32 Steps []*Step `json:"steps"` 33 Sources []*Source `json:"sources"` 34 BuildLogIDs []*BuildLogID `json:"buildLogIds"` 35 ResolvedRequirements []*RawResolvedRequirement `json:"resolvedRequirements"` 36 37 lookup map[strfmt.UUID]interface{} 38 } 39 40 // Artifact represents a downloadable artifact. 41 // This artifact may or may not be installable by the State Tool. 42 type Artifact struct { 43 Type string `json:"__typename"` 44 NodeID strfmt.UUID `json:"nodeId"` 45 DisplayName string `json:"displayName"` 46 MimeType string `json:"mimeType"` 47 GeneratedBy strfmt.UUID `json:"generatedBy"` 48 RuntimeDependencies []strfmt.UUID `json:"runtimeDependencies"` 49 Status string `json:"status"` 50 URL string `json:"url"` 51 LogURL string `json:"logURL"` 52 Errors []string `json:"errors"` 53 Checksum string `json:"checksum"` 54 } 55 56 // BuildLogID is the ID used to initiate a connection with the BuildLogStreamer. 57 type BuildLogID struct { 58 ID string `json:"id"` 59 PlatformID strfmt.UUID `json:"platformID"` 60 } 61 62 // NamedTarget is a special target used for terminals. 63 type NamedTarget struct { 64 Tag string `json:"tag"` 65 NodeIDs []strfmt.UUID `json:"nodeIds"` 66 } 67 68 // Step represents a single step in the build plan. 69 // A step takes some input, processes it, and produces some output. 70 // This is usually a build step. The input represents a set of target 71 // IDs and the output are a set of artifact IDs. 72 type Step struct { 73 StepID strfmt.UUID `json:"stepId"` 74 Inputs []*NamedTarget `json:"inputs"` 75 Outputs []string `json:"outputs"` 76 } 77 78 // Source represents the source of an artifact. 79 type Source struct { 80 NodeID strfmt.UUID `json:"nodeId"` 81 IngredientSource 82 } 83 84 type IngredientSource struct { 85 IngredientID strfmt.UUID `json:"ingredientId"` 86 IngredientVersionID strfmt.UUID `json:"ingredientVersionId"` 87 Revision int `json:"revision"` 88 Name string `json:"name"` 89 Namespace string `json:"namespace"` 90 Version string `json:"version"` 91 Licenses []string `json:"licenses"` 92 } 93 94 type RawResolvedRequirement struct { 95 Requirement *types.Requirement `json:"requirement"` 96 Source strfmt.UUID `json:"resolvedSource"` 97 }