---@class UploadMethod
---@field url string # The url to upload to. Can use BASE_URL & PRESIGNED_URL as well.
---@field field string # The field name (formData)
---@field headers? table<string, any>
---@field error? { path: string, value: any } # The path to the error value and the value to check for
---@field success { path: string } # The path to the video file
---@field suffix? string # Add a suffix to the url? Needed if the url doesn't return the correct file name
---@field sendPlayer? string # The formData field name to send player's metadata to, as json
---@field sendResource? boolean # Send the resource name in the formData?
---@type table<string, { Default: UploadMethod?, Video?: UploadMethod, Image?: UploadMethod, Audio?: UploadMethod }>
UploadMethods = {
Custom = {
Default = {
url = "PRESIGNED_URL",
field = "file",
success = {
path = "url"
},
sendPlayer = "metadata"
},
},
Fivemanage = {
Default = {
url = "PRESIGNED_URL",
field = "file",
success = {
path = "data.url"
},
sendPlayer = "metadata"
},
},
LBUpload = {
Default = {
url = "https://BASE_URL/lb-upload/",
field = "file",
headers = {
["Authorization"] = "API_KEY"
},
error = {
path = "success",
value = false
},
success = {
path = "link"
},
sendPlayer = "metadata"
},
},
OldFivemanage = {
Video = {
url = "https://fmapi.net/api/v2/video",
field = "file",
headers = {
["Authorization"] = "API_KEY"
},
success = {
path = "data.url"
},
},
Image = {
url = "https://fmapi.net/api/v2/image",
field = "file",
headers = {
["Authorization"] = "API_KEY"
},
success = {
path = "data.url"
}
},
Audio = {
url = "https://fmapi.net/api/v2/audio",
field = "file",
headers = {
["Authorization"] = "API_KEY"
},
success = {
path = "data.url"
}
},
},
}