Results
napt.results
Result types returned by napt commands.
Each dataclass here is what a napt command's underlying operation
returns: napt discover produces a DiscoverResult, napt build a
BuildResult, napt package a PackageResult, napt upload an
UploadResult, and napt validate a ValidationResult. The one
exception is DownloadResult, which comes from the shared download step
the discovery stage builds on. Command handlers consume these results
to render console output and choose exit codes; tests assert against
them.
All dataclasses are frozen (immutable) to prevent accidental mutation of return values.
Note
Only results that napt commands surface belong in this module. Domain types (like MSIMetadata) and internal types (like StrategyResult) should remain co-located with their related logic.
DownloadResult
dataclass
Result of a file download operation.
Attributes:
| Name | Type | Description |
|---|---|---|
file_path |
Path
|
Path to the downloaded file. |
sha256 |
str
|
SHA-256 hex digest of the downloaded file. |
headers |
dict
|
HTTP response headers from the download. |
Source code in napt/results.py
DiscoverResult
dataclass
Result from discovering a version and downloading an installer.
Attributes:
| Name | Type | Description |
|---|---|---|
app_name |
str
|
Application display name. |
app_id |
str
|
Unique application identifier. |
strategy |
str
|
Discovery strategy used (e.g., "web_scrape", "api_github"). |
version |
str
|
Extracted version string. |
version_source |
str
|
How version was determined (e.g., "regex_in_url", "msi"). |
file_path |
Path
|
Path to the downloaded installer file. |
sha256 |
str
|
SHA-256 hash of the downloaded file. |
status |
str
|
Always "success" for successful discovery. |
Source code in napt/results.py
BuildResult
dataclass
Result from building a PSADT package.
Attributes:
| Name | Type | Description |
|---|---|---|
app_id |
str
|
Unique application identifier. |
app_name |
str
|
Application display name. |
version |
str
|
Application version. |
build_dir |
Path
|
Path to the build directory (packagefiles subdirectory). |
psadt_version |
str
|
PSADT version used for the build. |
status |
str
|
Build status (typically "success"). |
build_types |
str
|
The build types setting used ("both", "app_only", or "update_only"). |
detection_script_path |
Path | None
|
Path to the generated detection script. |
requirements_script_path |
Path | None
|
Path to the generated requirements script, if created. None if build_types is "app_only". |
Source code in napt/results.py
PackageResult
dataclass
Result from creating a .intunewin package.
Attributes:
| Name | Type | Description |
|---|---|---|
build_dir |
Path
|
Path to the build directory. |
package_path |
Path
|
Path to the created .intunewin file. |
app_id |
str
|
Unique application identifier. |
version |
str
|
Application version. |
status |
str
|
Packaging status (typically "success"). |
Source code in napt/results.py
UploadResult
dataclass
Result from uploading a .intunewin package to Microsoft Intune.
Attributes:
| Name | Type | Description |
|---|---|---|
app_id |
str
|
Unique application identifier (from recipe). |
app_name |
str
|
Application display name. |
version |
str
|
Application version uploaded. |
intune_app_id |
str | None
|
Graph API object ID of the install app entry. None when build_types is "update_only". |
intune_update_app_id |
str | None
|
Graph API object ID of the update app entry. None when build_types is "app_only". |
package_path |
Path
|
Path to the uploaded .intunewin file. |
status |
str
|
Always "success" for successful uploads. |
Source code in napt/results.py
ValidationResult
dataclass
Result from validating a recipe.
Attributes:
| Name | Type | Description |
|---|---|---|
status |
str
|
Validation status ("valid" or "invalid"). |
errors |
list[str]
|
List of error messages (empty if valid). |
warnings |
list[str]
|
List of warning messages. |
app_count |
int
|
Number of apps in the recipe. |
recipe_path |
str
|
String path to the validated recipe file. |
parent_path |
str | None
|
String path to the parent recipe merged beneath it, or None when the recipe declares no parent. |