2022-08-30 13:52:06 +00:00
|
|
|
package onedrive
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
2022-08-31 13:01:15 +00:00
|
|
|
"github.com/alist-org/alist/v3/internal/op"
|
2022-08-30 13:52:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Addition struct {
|
2022-09-04 05:07:53 +00:00
|
|
|
driver.RootPath
|
2022-10-01 12:09:57 +00:00
|
|
|
Region string `json:"region" type:"select" required:"true" options:"global,cn,us,de" default:"global"`
|
2022-08-30 13:52:06 +00:00
|
|
|
IsSharepoint bool `json:"is_sharepoint"`
|
2022-09-02 14:46:31 +00:00
|
|
|
ClientID string `json:"client_id" required:"true"`
|
2022-08-30 13:52:06 +00:00
|
|
|
ClientSecret string `json:"client_secret" required:"true"`
|
2023-02-16 13:37:20 +00:00
|
|
|
RedirectUri string `json:"redirect_uri" required:"true" default:"https://alist.nn.ci/tool/onedrive/callback"`
|
2022-08-30 13:52:06 +00:00
|
|
|
RefreshToken string `json:"refresh_token" required:"true"`
|
|
|
|
SiteId string `json:"site_id"`
|
2022-10-08 14:23:33 +00:00
|
|
|
ChunkSize int64 `json:"chunk_size" type:"number" default:"5"`
|
2023-10-02 06:07:47 +00:00
|
|
|
CustomHost string `json:"custom_host" help:"Custom host for onedrive download link"`
|
2022-08-30 13:52:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var config = driver.Config{
|
2022-09-01 14:13:37 +00:00
|
|
|
Name: "Onedrive",
|
2022-08-30 13:52:06 +00:00
|
|
|
LocalSort: true,
|
|
|
|
DefaultRoot: "/",
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2022-12-13 10:03:30 +00:00
|
|
|
op.RegisterDriver(func() driver.Driver {
|
|
|
|
return &Onedrive{}
|
|
|
|
})
|
2022-08-30 13:52:06 +00:00
|
|
|
}
|