addonscript-spec/docs/schema/file.md

57 lines
2 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",
2023-10-11 14:40:50 +02:00
"src": ["https://example.com/mymod.jar", "./mymod.jar"],
2022-09-03 21:23:53 +02:00
"flags": {},
"install": [],
2022-06-25 22:14:43 +02:00
"hashes": {
"sha1": "somesha1checksum"
2022-09-21 11:08:10 +02:00
},
"meta": {}
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.
It MUST only contains lowercase alphanumeric characters and hyphens and SHOULD be written in the `kebab-case` format.
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
2023-10-11 14:40:50 +02:00
### src
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.
If none of the specified links works or the array is empty, the file link SHOULD be retrieved by it's identifier
2022-08-31 14:40:32 +02:00
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 will be installed to the game.
The order in the array corresponds to the order in which the installation steps will be applied.
2021-06-23 22:06:21 +02:00
### flags
2022-09-03 21:23:53 +02:00
This is an [flags object](flags.md) which contains [relational flags](../concepts/flags.md#relational-flags) for both sides for this file.
If a file has no flag for a side, the file will be ignored for that side.
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`
2022-09-21 11:08:10 +02:00
### meta
This is a [meta object](meta.md) containing metadata about the file. it SHOULD only contain [additional metadata](meta.md#additional).