From bbb3263a0cb66557ced206326d845022efe8ba7b Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 23 May 2020 17:24:12 +0300 Subject: [PATCH] feat(core): add Files API basic files #428 --- src/flextype/core/Files/Files.php | 45 +++++++++++++++++++++++ src/flextype/endpoints/delivery/files.php | 29 +++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 src/flextype/core/Files/Files.php create mode 100644 src/flextype/endpoints/delivery/files.php diff --git a/src/flextype/core/Files/Files.php b/src/flextype/core/Files/Files.php new file mode 100644 index 00000000..c5f889a0 --- /dev/null +++ b/src/flextype/core/Files/Files.php @@ -0,0 +1,45 @@ +flextype = $flextype; + } + + /** + * Create file + * + * @param string $data Unique identifier of the entry(entries). + * @return array The entry array data. + * + * @access public + */ + public function create(string $data) : array + { + + } +} diff --git a/src/flextype/endpoints/delivery/files.php b/src/flextype/endpoints/delivery/files.php new file mode 100644 index 00000000..210539c7 --- /dev/null +++ b/src/flextype/endpoints/delivery/files.php @@ -0,0 +1,29 @@ + ['type' => 'Error', 'id' => 'AccessTokenInvalid'], 'message' => 'The access token you sent could not be found or is invalid.']; +$api_sys_messages['NotFound'] = ['sys' => ['type' => 'Error', 'id' => 'NotFound'], 'message' => 'The resource could not be found.']; + +/** + * Validate delivery files token + */ +function validate_delivery_files_token($token) : bool +{ + return Filesystem::has(PATH['project'] . '/tokens/delivery/files/' . $token . '/token.yaml'); +}