Skip to content

Commit

Permalink
Added Missing API
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnv committed Sep 23, 2021
1 parent 05bf1d6 commit 6e44c66
Show file tree
Hide file tree
Showing 23 changed files with 1,274 additions and 620 deletions.
3 changes: 0 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix="Interface.php">src/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="">
Expand Down
274 changes: 0 additions & 274 deletions sample/sample.php

This file was deleted.

Binary file removed sample/sample_image.jpg
Binary file not shown.
74 changes: 74 additions & 0 deletions src/ImageKit/Constants/Endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,80 @@ public static function getFileMetadataFromRemoteURLEndpoint()
return (self::API_BASE_ENDPOINT . '/metadata');
}

/**
* @return string
*/
public static function getBulkAddTagsEndpoint()
{
return (self::API_BASE_ENDPOINT . '/files/addTags');
}

/**
* @return string
*/
public static function getBulkRemoveTagsEndpoint()
{
return (self::API_BASE_ENDPOINT . '/files/removeTags');
}

/**
* @return string
*/
public static function getCopyFileEndpoint()
{
return (self::API_BASE_ENDPOINT . '/files/copy');
}

/**
* @return string
*/
public static function getMoveFileEndpoint()
{
return (self::API_BASE_ENDPOINT . '/files/move');
}

/**
* @return string
* @var $jobId
*
*/
public static function getBulkJobStatusEndpoint($jobId)
{
return (self::API_BASE_ENDPOINT . '/bulkJobs/' . $jobId);
}

/**
* @return string
*/
public static function getCreateFolderEndpoint()
{
return (self::API_BASE_ENDPOINT . '/folder/');
}

/**
* @return string
*/
public static function getDeleteFolderEndpoint()
{
return (self::API_BASE_ENDPOINT . '/folder/');
}

/**
* @return string
*/
public static function getCopyFolderEndpoint()
{
return (self::API_BASE_ENDPOINT . '/bulkJobs/copyFolder');
}

/**
* @return string
*/
public static function getMoveFolderEndpoint()
{
return (self::API_BASE_ENDPOINT . '/bulkJobs/moveFolder');
}

}


10 changes: 9 additions & 1 deletion src/ImageKit/Constants/errorMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ class ErrorMessages
public static $INVALID_LIST_FILES_OPTIONS = ['message' => 'Invalid List Files Options ImageKit initialization', 'help' => ''];
public static $MANDATORY_INITIALIZATION_MISSING = ['message' => 'Missing publicKey or privateKey or urlEndpoint during ImageKit initialization', 'help' => ''];
public static $INVALID_TRANSFORMATION_POSITION = ['message' => 'Invalid transformationPosition parameter', 'help' => ''];
public static $INVALID_FILE_OPTIONS = ['message' => 'Invalid File Optios ImageKit initialization', 'help' => ''];
public static $INVALID_FILE_OPTIONS = ['message' => 'Invalid File Options ImageKit initialization', 'help' => ''];
public static $CACHE_PURGE_URL_MISSING = ['message' => 'Missing URL parameter for this request', 'help' => ''];
public static $CACHE_PURGE_STATUS_ID_MISSING = ['message' => 'Missing Request ID parameter for this request', 'help' => ''];
public static $fileId_MISSING = ['message' => 'Missing File ID parameter for this request', 'help' => ''];
public static $JOBID_MISSING = ['message' => 'Missing Job ID parameter for this request', 'help' => ''];
public static $UPDATE_DATA_MISSING = ['message' => 'Missing file update data for this request', 'help' => ''];
public static $BULK_TAGS_DATA_MISSING = ['message' => 'Missing bulk tag update data for this request', 'help' => ''];
public static $UPDATE_DATA_TAGS_INVALID = ['message' => 'Invalid tags parameter for this request', 'help' => "tags should be passed as null or an array like ['tag1', 'tag2']"];
public static $UPDATE_DATA_COORDS_INVALID = ['message' => 'Invalid customCoordinates parameter for this request', 'help' => "customCoordinates should be passed as null or a string like 'x,y,width,height'"];
public static $LIST_FILES_INPUT_MISSING = ['message' => 'Missing options for list files', 'help' => 'if you do not want to pass any parameter for listing, pass an empty object'];
Expand All @@ -28,4 +30,10 @@ class ErrorMessages
public static $UNEQUAL_STRING_LENGTH = ['message' => 'Unequal pHash string length', 'help' => 'For distance calucation, the two pHash strings must have equal length'];
public static $fileIdS_MISSING = ['message' => 'FileIds parameter is missing.', 'help' => 'For support kindly contact us at [email protected] .'];
public static $MISSING_URL_PARAMETER = ['message' => 'Your request is missing the url query paramater.', 'help' => 'For support kindly contact us at [email protected] .'];
public static $COPY_FILE_DATA_INVALID = ['message' => 'Missing sourceFilePath and/or destinationPath for copy file.', 'help' =>
'For support kindly contact us at [email protected] .'];
public static $MISSING_CREATE_FOLDER_OPTIONS = ['message' => 'Missing data for creation of folder', 'help' => ''];
public static $MISSING_DELETE_FOLDER_OPTIONS = ['message' => 'Missing data for deletion of folder', 'help' => ''];
public static $MISSING_COPY_FOLDER_OPTIONS = ['message' => 'Missing data for copying folder', 'help' => ''];
public static $MISSING_MOVE_FOLDER_OPTIONS = ['message' => 'Missing data for moving folder', 'help' => ''];
}
Loading

0 comments on commit 6e44c66

Please sign in to comment.