<?php

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

$APIS = [
    "ping" => [
        "load" => "ping.php",
        "vars" => [
        ]
    ],
    "lookup" => [
        "load" => "machine.php",
        "vars" => [
            "id" => "/^[0-9a-zA-Z]+$/"
        ]
    ],
    "getlabel" => [
        "load" => "label.php",
        "vars" => [
            "id" => "/^[0-9a-zA-Z]+$/",
            "type" => "string"
        ]
    ],
    "listlabels" => [
        "load" => "label.php",
        "vars" => []
    ],
    "editmachine" => [
        "load" => "machine.php",
        "vars" => [
            "id" => "/^[0-9a-zA-Z]+$/",
            "type (optional)" => "numeric",
            "model (optional)" => "string",
            "clientid (optional)" => "string",
            "os (optional)" => "string",
            "serial (optional)" => "string",
            "manufacturer (optional)" => "string",
            "condition (optional)" => "numeric",
            "price (optional)" => "numeric",
            "privatenotes (optional)" => "string",
            "publicnotes (optional)" => "string"
        ]
    ],
    "addmachine" => [
        "load" => "machine.php",
        "vars" => [
            "type (optional)" => "numeric",
            "model (optional)" => "string",
            "clientid (optional)" => "string",
            "os (optional)" => "string",
            "serial (optional)" => "string",
            "manufacturer (optional)" => "string",
            "condition (optional)" => "numeric",
            "price (optional)" => "numeric",
            "privatenotes (optional)" => "string",
            "publicnotes (optional)" => "string"
        ]
    ],
    "getmachineformfields" => [
        "load" => "machine.php",
        "vars" => []
    ],
    "getclient" => [
        "load" => "client.php",
        "vars" => [
            "clientid" => "string"
        ]
    ],
    "getclients" => [
        "load" => "client.php",
        "vars" => [
        ]
    ],
    "searchclients" => [
        "load" => "client.php",
        "vars" => [
            "q" => "string"
        ]
    ],
    "addevent" => [
        "load" => "addevent.php",
        "vars" => [
            "id" => "/^[0-9a-zA-Z]+$/",
            "date" => "string",
            "event" => "string",
            "publicnotes (optional)" => "string",
            "privatenotes (optional)" => "string"
        ]
    ],
    "geteventtypes" => [
        "load" => "geteventtypes.php",
        "vars" => [
        ]
    ]
];
