diff --git a/schemas/materialtrade-README.md b/schemas/materialtrade-README.md new file mode 100644 index 0000000..c9bbebb --- /dev/null +++ b/schemas/materialtrade-README.md @@ -0,0 +1,46 @@ +# EDDN MaterialTrade Schema + +## Introduction +Here we document how to take data from an ED `MaterialTrade` Journal Event and +properly structure it for sending to EDDN. + +Please consult [EDDN Schemas README](./README-EDDN-schemas.md) for general +documentation for a schema such as this. + +If you find any discrepancies between what this document says and what is +defined in the relevant Schema file, then you should, in the first instance, +assume that it is the Schema file that is correct. +**PLEASE open +[an issue on GitHub](https://github.com/EDCD/EDDN/issues/new/choose) +to report any such anomalies you find so that we can check and resolve the +discrepancy.** + +## Senders +The primary data source for this schema is the ED Journal event `MaterialTrade`. +This event occurs when a commander trades materials at a Material Trader. + +### Required Fields +The following fields from the Journal event **MUST** be included: +- `timestamp` - When the trade occurred +- `event` - Always "MaterialTrade" +- `MarketID` - The unique identifier for the station's market +- `TraderType` - The type of material trader (e.g. "encoded", "manufactured", "raw") + +### Elisions +You **MUST** remove the following key/value pairs from the data: +- `Paid` - This is the material that was paid for the trade +- `Received` - This is the material that was received for the trade + +### Rate Limiting +Since these values can occur multiple times in a short timespan, senders +*must* take care to only send them once at most per event type while +docked at a station. + +### Augmentations +#### horizons and odyssey flags +Please read [horizons and odyssey flags](../docs/Developers.md#horizons-and-odyssey-flags) +in the Developers' documentation. + +#### gameversion and gamebuild +You **MUST** always set these as per [the relevant section](../docs/Developers.md#gameversions-and-gamebuild) +of the Developers' documentation. \ No newline at end of file diff --git a/schemas/materialtrade-v1.0.json b/schemas/materialtrade-v1.0.json new file mode 100644 index 0000000..d5cce71 --- /dev/null +++ b/schemas/materialtrade-v1.0.json @@ -0,0 +1,62 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "id" : "https://eddn.edcd.io/schemas/materialtrade/1#", + "type" : "object", + "additionalProperties" : false, + "required": [ "$schemaRef", "header", "message" ], + "properties": { + "$schemaRef": { + "type" : "string" + }, + "header": { + "type" : "object", + "additionalProperties" : true, + "required" : [ "uploaderID", "softwareName", "softwareVersion" ], + "properties" : { + "uploaderID": { + "type" : "string" + }, + "gameversion": { + "type" : "string", + "description" : "From Fileheader event if available, else LoadGame if available there." + }, + "gamebuild": { + "type" : "string", + "description" : "The `build` value from a Fileheader event if available, else LoadGame if available there." + }, + "softwareName": { + "type" : "string" + }, + "softwareVersion": { + "type" : "string" + }, + "gatewayTimestamp": { + "type" : "string", + "format" : "date-time", + "description" : "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property." + } + } + }, + "message": { + "type" : "object", + "additionalProperties" : false, + "required" : [ "timestamp", "event", "MarketID", "TraderType" ], + "properties" : { + "timestamp": { + "type" : "string", + "format" : "date-time" + }, + "event": { + "type" : "string", + "enum" : [ "MaterialTrade" ] + }, + "MarketID": { + "type" : "integer" + }, + "TraderType": { + "type" : "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/technologybroker-README.md b/schemas/technologybroker-README.md new file mode 100644 index 0000000..d0c42a5 --- /dev/null +++ b/schemas/technologybroker-README.md @@ -0,0 +1,46 @@ +# EDDN TechnologyBroker Schema + +## Introduction +Here we document how to take data from an ED `TechnologyBroker` Journal Event and +properly structure it for sending to EDDN. + +Please consult [EDDN Schemas README](./README-EDDN-schemas.md) for general +documentation for a schema such as this. + +If you find any discrepancies between what this document says and what is +defined in the relevant Schema file, then you should, in the first instance, +assume that it is the Schema file that is correct. +**PLEASE open [an issue on GitHub](https://github.com/EDCD/EDDN/issues/new/choose) +to report any such anomalies you find so that we can check and resolve the +discrepancy.** + +## Senders +The primary data source for this schema is the ED Journal event `TechnologyBroker`. +This event occurs when a commander unlocks new technology at a Technology Broker. + +### Required Fields +The following fields from the Journal event **MUST** be included: +- `timestamp` - When the technology was unlocked +- `event` - Always "TechnologyBroker" +- `MarketID` - The unique identifier for the station's market +- `BrokerType` - The type of technology broker (e.g. "guardian", "human", "sirius") + +### Elisions +You **MUST** remove the following key/value pairs from the data: +- `ItemsUnlocked` - This is the list of items that were unlocked +- `Commodities` - This is the list of commodities that were paid for the unlock +- `Materials` - This is the list of materials that were paid for the unlock + +### Rate Limiting +Since these values can occur multiple times in a short timespan, senders +*must* take care to only send them once at most per event type while +docked at a station. + +### Augmentations +#### horizons and odyssey flags +Please read [horizons and odyssey flags](../docs/Developers.md#horizons-and-odyssey-flags) +in the Developers' documentation. + +#### gameversion and gamebuild +You **MUST** always set these as per [the relevant section](../docs/Developers.md#gameversions-and-gamebuild) +of the Developers' documentation. \ No newline at end of file diff --git a/schemas/technologybroker-v1.0.json b/schemas/technologybroker-v1.0.json new file mode 100644 index 0000000..1de32ee --- /dev/null +++ b/schemas/technologybroker-v1.0.json @@ -0,0 +1,62 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "id" : "https://eddn.edcd.io/schemas/technologybroker/1#", + "type" : "object", + "additionalProperties" : false, + "required": [ "$schemaRef", "header", "message" ], + "properties": { + "$schemaRef": { + "type" : "string" + }, + "header": { + "type" : "object", + "additionalProperties" : true, + "required" : [ "uploaderID", "softwareName", "softwareVersion" ], + "properties" : { + "uploaderID": { + "type" : "string" + }, + "gameversion": { + "type" : "string", + "description" : "From Fileheader event if available, else LoadGame if available there." + }, + "gamebuild": { + "type" : "string", + "description" : "The `build` value from a Fileheader event if available, else LoadGame if available there." + }, + "softwareName": { + "type" : "string" + }, + "softwareVersion": { + "type" : "string" + }, + "gatewayTimestamp": { + "type" : "string", + "format" : "date-time", + "description" : "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property." + } + } + }, + "message": { + "type" : "object", + "additionalProperties" : false, + "required" : [ "timestamp", "event", "MarketID", "BrokerType" ], + "properties" : { + "timestamp": { + "type" : "string", + "format" : "date-time" + }, + "event": { + "type" : "string", + "enum" : [ "TechnologyBroker" ] + }, + "MarketID": { + "type" : "integer" + }, + "BrokerType": { + "type" : "string" + } + } + } + } +} \ No newline at end of file