apps

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BundleIDCompanyPortal  = "com.microsoft.CompanyPortalMac"
	BundleIDExcel          = "com.microsoft.Excel"
	BundleIDOneDrive       = "com.microsoft.OneDrive"
	BundleIDOutlook        = "com.microsoft.Outlook"
	BundleIDPowerPoint     = "com.microsoft.Powerpoint"
	BundleIDVSCode         = "com.microsoft.VSCode"
	BundleIDWord           = "com.microsoft.Word"
	BundleIDOffice365Suite = "com.microsoft.office.suite"
	BundleIDOneNote        = "com.microsoft.onenote.mac"
	BundleIDWindowsApp     = "com.microsoft.rdc.macos"
	BundleIDTeams          = "com.microsoft.teams2"
	BundleIDDefender       = "com.microsoft.wdav"
	BundleIDAutoUpdate     = "com.microsoft.autoupdate2"
	BundleIDEdge           = "com.microsoft.edgemac"
	BundleIDIntuneAgent    = "com.microsoft.intuneMDMAgent"
	BundleIDM365Copilot    = "com.microsoft.m365copilot"
)

Common application bundle IDs

View Source
const (
	AppNameCompanyPortal = "Company Portal"
	AppNameExcel         = "Microsoft Excel"
	AppNameOneDrive      = "Microsoft OneDrive"
	AppNameOutlook       = "Microsoft Outlook"
	AppNamePowerPoint    = "Microsoft PowerPoint"
	AppNameVSCode        = "Visual Studio Code"
	AppNameWord          = "Microsoft Word"
	AppNameOffice365     = "Office 365 for Mac"
	AppNameOneNote       = "Microsoft OneNote"
	AppNameWindowsApp    = "Windows App"
	AppNameTeams         = "Microsoft Teams"
	AppNameDefender      = "Defender for Mac"
	AppNameAutoUpdate    = "Microsoft AutoUpdate"
	AppNameEdge          = "Microsoft Edge"
	AppNameIntuneAgent   = "Intune Agent"
	AppNameM365Copilot   = "M365 Copilot"
)

Common application names

View Source
const (
	EndpointLatest = "/latest"
)

API Endpoints

View Source
const (
	TypeApplication = "application"
)

Application type constants

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	AppPath        string      `json:"app_path"`
	BundleID       string      `json:"bundle_id"`
	ComponentCount int         `json:"component_count,omitempty"`
	Components     []Component `json:"components,omitempty"`
	Detected       string      `json:"detected"`
	DirectURL      string      `json:"direct_url"`
	DownloadURL    string      `json:"download_url"`
	ETag           string      `json:"etag"`
	InstallKB      *int        `json:"install_kb,omitempty"`
	LastModified   string      `json:"last_modified"`
	Name           string      `json:"name"`
	NumFiles       *int        `json:"num_files,omitempty"`
	PackageID      string      `json:"package_identifier"`
	SHA256         string      `json:"sha256"`
	SizeBytes      int64       `json:"size_bytes"`
	SizeMB         float64     `json:"size_mb"`
	Type           string      `json:"type"`
	Version        string      `json:"version"`
}

App represents a Microsoft application for Mac

func (*App) ParseDetectedTime

func (a *App) ParseDetectedTime() (time.Time, error)

ParseDetectedTime parses the detected timestamp

func (*App) ParseLastModifiedTime

func (a *App) ParseLastModifiedTime() (time.Time, error)

ParseLastModifiedTime parses the last modified timestamp

type AppsResponse

type AppsResponse struct {
	Apps      []App  `json:"apps"`
	Generated string `json:"generated"`
}

AppsResponse represents the complete API response

func (*AppsResponse) ParseGeneratedTime

func (r *AppsResponse) ParseGeneratedTime() (time.Time, error)

ParseGeneratedTime parses the generated timestamp from the response

type AppsService

type AppsService struct {
	// contains filtered or unexported fields
}

AppsService handles communication with the apps related methods of the Microsoft Mac Apps API

func NewService

func NewService(client interfaces.HTTPClient) *AppsService

NewService creates a new apps service

func (*AppsService) GetAppByBundleID

func (s *AppsService) GetAppByBundleID(ctx context.Context, bundleID string) (*App, error)

GetAppByBundleID finds an application by its bundle ID

func (*AppsService) GetAppByName

func (s *AppsService) GetAppByName(ctx context.Context, name string) (*App, error)

GetAppByName finds an application by its name

func (*AppsService) GetLatestApps

func (s *AppsService) GetLatestApps(ctx context.Context) (*AppsResponse, error)

GetLatestApps retrieves the latest Microsoft Mac application versions URL: GET https://appledevicepolicy.tools/api/latest

type AppsServiceInterface

type AppsServiceInterface interface {
	// GetLatestApps retrieves the latest Microsoft Mac application versions
	//
	// API docs: https://appledevicepolicy.tools/microsoft-apps
	GetLatestApps(ctx context.Context) (*AppsResponse, error)

	// GetAppByBundleID finds an application by its bundle ID
	GetAppByBundleID(ctx context.Context, bundleID string) (*App, error)

	// GetAppByName finds an application by its name
	GetAppByName(ctx context.Context, name string) (*App, error)
}

AppsServiceInterface defines the interface for apps operations

type Component

type Component struct {
	AppPath   *string `json:"app_path"`
	BundleID  *string `json:"bundle_id"`
	Name      string  `json:"name"`
	PackageID string  `json:"package_identifier"`
	Version   string  `json:"version"`
}

Component represents a component bundled with an application

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL