Results
napt.results
Public API return types for NAPT.
This module defines dataclasses for return values from public API functions. These types represent the results of operations like discovery, building, packaging, and validation.
All dataclasses are frozen (immutable) to prevent accidental mutation of return values.
Example
Using result types:
Note
Only public API return types belong in this module. Domain types (like DiscoveredVersion) and internal types (like LoadContext) 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
|
Graph API object ID of the newly created Intune Win32 app. |
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. |