addonscript-spec/docs/schema/file.md

54 lines
1.9 KiB
Markdown
Raw Normal View History

2021-06-23 22:06:21 +02:00
# File Object
2021-11-14 00:37:29 +01:00
```json
2021-06-23 22:06:21 +02:00
{
2022-08-22 21:24:34 +02:00
"qualifier": "modfile",
2022-02-16 23:12:50 +01:00
"link": ["https://example.com/mymod.jar", "./mymod.jar"],
2021-07-18 12:32:57 +02:00
"flags": [],
"install": [],
2022-06-25 22:14:43 +02:00
"hashes": {
"sha1": "somesha1checksum"
}
2021-06-23 22:06:21 +02:00
}
```
## Required properties
2022-08-22 21:24:34 +02:00
### qualifier
2021-06-23 22:06:21 +02:00
2022-08-22 21:24:34 +02:00
This is the qualifier of this file.
2021-11-14 00:17:32 +01:00
It should be written in the `kebab-case` format, meaning lowercase only and using `-` instead of spaces.
2022-08-22 21:24:34 +02:00
The qualifier has to be unique to this addon version. The namespace, addon ID, version and qualifier
can together be used to uniquely identify a file.
2021-06-23 22:06:21 +02:00
2022-01-29 17:33:32 +01:00
### link
2021-06-23 22:06:21 +02:00
2022-02-26 12:27:59 +01:00
This is an array of [links](../concepts/links.md), which are pointing to the actual file. All of these links must
2022-02-16 23:12:50 +01:00
have the same file type. Since AddonScript treats directories and zip files equally,
they can be mixed in the same link array. When downloading the file,
the first link in this array should be used with the other links as fallback, if the first doesn't work.
2022-08-31 14:40:32 +02:00
If none of the specified links works or the array is empty, the file link should be retrieved by it's identifier
from one of the [repositories](repository.md), but only, if a `sha1` hash is specified, so that it can be
verified, that the downloaded file is correct.
2022-02-16 23:12:50 +01:00
## Optional properties
2021-06-23 22:06:21 +02:00
### install
This is an array of [install objects](install.md). They describe how the file should be installed to the game.
The order in the array corresponds to the order in which the installation steps should be applied.
2021-06-23 22:06:21 +02:00
### flags
2022-06-08 19:44:19 +02:00
This is an array of [flags](../concepts/flags.md) for this file. If this property is not present in a file object, the file will
2022-08-31 16:11:10 +02:00
inherit the [side flags](../concepts/flags.md#side-flags) from the [version](manifest.md) and have the `required` flag set by default.
2021-06-23 22:06:21 +02:00
2022-06-25 22:14:43 +02:00
### hashes
2021-06-23 22:06:21 +02:00
2022-06-25 22:14:43 +02:00
This is an object with checksums for this file. The object contains key-value-pairs where the key is the hash algorithm and the
value is the checksum.
Supported hash algorithms:
- `sha1`