expensify

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCookiesFromJSON added in v1.2.0

func LoadCookiesFromJSON(filePath string) ([]*http.Cookie, error)

loadCookiesFromJSON reads cookies from a JSON file and returns them

Types

type Client added in v1.2.0

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

Client is a struct to hold the ExpensifyClient information

func NewClient

func NewClient(partnerUserID, partnerUserSecret string) (*Client, error)

NewClient creates a new ExpensifyClient

func (*Client) ConfigureFileExport added in v1.2.0

func (c *Client) ConfigureFileExport(config FileExportConfig,
	sendEmailOnFinish *OnFinishSendEmail,
	markAsExportedOnFinish *OnFinishMarkAsExported,
	uploadToSftpOnFinish *OnFinishSftpUploadData,
) error

func (*Client) DownloadReport added in v1.2.0

func (c *Client) DownloadReport(ctx context.Context, report *ExpensifyReport) error

DownloadReport downloads the data of exported report

func (*Client) ExecuteFileExport added in v1.2.0

func (c *Client) ExecuteFileExport(ctx context.Context, reportFields []string, expenseFields []string) ([]*ExpensifyReport, error)

ExecuteFileExport configures the export request. Everything that is marked a point is nullable (meaning it is optional to configure) -filterByMarkedAsApprovedTag : pass the tag you are looking for

type ExpensifyReport added in v1.2.0

type ExpensifyReport struct {
	FileName   string `json:"fileName"`
	FileSystem string `json:"fileSystem"`
	Data       []byte `json:"data"`
}

func (*ExpensifyReport) WriteToDisk added in v1.2.0

func (er *ExpensifyReport) WriteToDisk(ctx context.Context, filePath string) error

type FileExportConfig

type FileExportConfig struct {
	FilterByReportId              []string
	FilterByPolicyId              []string
	FilterByStartDate             *time.Time
	FilterByEndDate               *time.Time
	FilterByApprovedAfterDate     *time.Time
	FilterByMarkedAsApprovedTag   *string
	FilterByEmployeeEmail         *string
	FilterByReportState           []string
	LimitNumberOfReportsExported  *int
	OutputFileExtension           string
	OutputFileBaseName            *string
	OutputIncludeFullPageReceipts bool
	IsThisAtestCall               bool
}

type Image added in v1.2.0

type Image struct {
	FileName string
	FileExt  string
	Data     []byte
}

Image struct holds the file name, file extension, and data

func GetImage added in v1.2.0

func GetImage(url string, cookies []*http.Cookie) (*Image, error)

GetImage get image downloads the image from a URL, it requires a set of active session cookies

func (*Image) WriteToDisk added in v1.2.0

func (i *Image) WriteToDisk(path string) error

type OnFinishMarkAsExported

type OnFinishMarkAsExported struct {
	Label string `json:"label"`
}

type OnFinishSendEmail

type OnFinishSendEmail struct {
	Recipients []string `json:"recipients"`
	Message    string   `json:"message"`
}

type OnFinishSftpUploadData

type OnFinishSftpUploadData struct {
	SftpData struct {
		Host     string `json:"host"`
		Login    string `json:"login"`
		Password string `json:"password"`
		Port     int    `json:"port"`
	} `json:"sftpData"`
}

Jump to

Keyboard shortcuts

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